Development 6
This commit is contained in:
@@ -26,26 +26,30 @@ namespace FoxTube.Background
|
||||
public NotificationType Type { get; set; }
|
||||
public string Avatar { get; set; }
|
||||
public string Thumbnail { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
public Notification(NotificationType type,
|
||||
public Notification(string type, string id,
|
||||
string channelName, string content, DateTime date,
|
||||
string thumbnailUrl, string avatarUrl = "ms-appx:///Assets/Icons/Profile.png")
|
||||
{
|
||||
Channel = channelName;
|
||||
Content = content;
|
||||
TimeStamp = date;
|
||||
Type = type;
|
||||
Type = TypeConversion(type);
|
||||
Avatar = avatarUrl;
|
||||
Thumbnail = thumbnailUrl;
|
||||
}
|
||||
|
||||
public string GetXml()
|
||||
{
|
||||
|
||||
return string.Empty;
|
||||
return $@"<item time='{TimeStamp.ToString("YYYY-MM-DDThh:mm:ss")}' type='{TypeConversion(Type)}' id='{Id}'>
|
||||
<images thumbnail='{Thumbnail}' avatar='{Avatar}'/>
|
||||
<channelName>{Channel}</channelName>
|
||||
<content>{Content}</content>
|
||||
</item>";
|
||||
}
|
||||
|
||||
public UIElement GetNotification()
|
||||
public Button GetNotification()
|
||||
{
|
||||
StackPanel stackPanel = new StackPanel() { Margin = new Thickness(10, 0, 0, 0) };
|
||||
|
||||
@@ -231,5 +235,35 @@ namespace FoxTube.Background
|
||||
|
||||
return new ToastNotification(template);
|
||||
}
|
||||
|
||||
private string TypeConversion(NotificationType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case NotificationType.Comment:
|
||||
return "comment";
|
||||
case NotificationType.Post:
|
||||
return "post";
|
||||
case NotificationType.Video:
|
||||
return "video";
|
||||
default:
|
||||
return "internal";
|
||||
}
|
||||
}
|
||||
|
||||
private NotificationType TypeConversion(string type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case "comment":
|
||||
return NotificationType.Comment;
|
||||
case "post":
|
||||
return NotificationType.Post;
|
||||
case "video":
|
||||
return NotificationType.Video;
|
||||
default:
|
||||
return NotificationType.Internal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user