70 lines
1.8 KiB
C#
70 lines
1.8 KiB
C#
using System;
|
|
using Windows.ApplicationModel.Resources;
|
|
|
|
namespace FoxTube.Classes
|
|
{
|
|
public enum InboxItemType { Default, PatchNote}
|
|
|
|
public class InboxItem
|
|
{
|
|
public InboxItemType Type { get; set; } = InboxItemType.Default;
|
|
public DateTime TimeStamp { get; set; }
|
|
|
|
public string Subject { get; set; }
|
|
public string Content { get; set; }
|
|
public string Id { get; set; }
|
|
|
|
private ResourceLoader resources = ResourceLoader.GetForCurrentView("Inbox");
|
|
|
|
public string Icon
|
|
{
|
|
get
|
|
{
|
|
if (Type == InboxItemType.PatchNote)
|
|
return "\xE728";
|
|
else
|
|
return "\xE119";
|
|
}
|
|
}
|
|
public string Subtitle
|
|
{
|
|
get
|
|
{
|
|
if (Type == InboxItemType.PatchNote)
|
|
return resources.GetString("changelog");
|
|
else
|
|
return resources.GetString("dev");
|
|
}
|
|
}
|
|
|
|
public string Title
|
|
{
|
|
get
|
|
{
|
|
if (Type == InboxItemType.PatchNote)
|
|
return $"{resources.GetString("whatsnew")}{Id}";
|
|
else
|
|
return Subject;
|
|
}
|
|
}
|
|
|
|
|
|
public InboxItem(string version, string content, string timeStamp)
|
|
{
|
|
Type = InboxItemType.PatchNote;
|
|
Content = content;
|
|
TimeStamp = DateTime.Parse(timeStamp);
|
|
Id = version;
|
|
}
|
|
|
|
public InboxItem(string title, string content, DateTime timeStamp, string id)
|
|
{
|
|
Type = InboxItemType.Default;
|
|
Content = content;
|
|
Subject = title;
|
|
TimeStamp = timeStamp;
|
|
Id = id;
|
|
}
|
|
}
|
|
}
|