Archived
1
0
This repository has been archived on 2026-04-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FoxTube/FoxTube/Classes/InboxItem.cs
T
2019-02-02 15:14:35 +03:00

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;
}
}
}