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
2018-08-18 09:21:57 +03:00

70 lines
1.7 KiB
C#

using System;
using System.Xml;
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 PatchVersion { get; set; }
public string Subject { get; set; }
public string Content { get; set; }
public string Id { get; set; }
public string Icon
{
get
{
if (Type == InboxItemType.PatchNote)
return "\xE728";
else
return "\xE119";
}
}
public string Subtitle
{
get
{
if (Type == InboxItemType.PatchNote)
return "Patch note";
else
return "Developer's message";
}
}
public string Title
{
get
{
if (Type == InboxItemType.PatchNote)
return $"What's new in v{PatchVersion}";
else
return Subject;
}
}
public InboxItem(string version, string content, string timeStamp, string id)
{
Type = InboxItemType.PatchNote;
PatchVersion = version;
Content = content;
TimeStamp = DateTime.Parse(timeStamp);
Id = id;
}
public InboxItem(string title, string content, DateTime timeStamp, string id)
{
Type = InboxItemType.Default;
Content = content;
Subject = title;
TimeStamp = timeStamp;
Id = id;
}
}
}