Archived
1
0

Inbox development 1

This commit is contained in:
Michael Gordeev
2018-07-29 00:11:18 +03:00
parent 2aa0b18091
commit 2ab98fc0d8
5 changed files with 243 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Xml;
namespace FoxTube.Classes
{
public enum InboxItemType { Default, PatchNote}
public class InboxItem
{
public InboxItemType Type { get; set; } = InboxItemType.Default;
DateTime TimeStamp { get; set; }
public string PatchVersion { get; set; }
public string Subject { get; set; }
public string Content { get; set; }
public string Icon
{
get
{
if (Type == InboxItemType.PatchNote)
return @"";
else
return @"";
}
}
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)
{
Type = InboxItemType.PatchNote;
PatchVersion = version;
Content = content;
TimeStamp = XmlConvert.ToDateTime(timeStamp, XmlDateTimeSerializationMode.Unspecified);
}
public InboxItem(string title, string content, DateTime timeStamp)
{
Type = InboxItemType.Default;
Content = content;
TimeStamp = timeStamp;
}
}
}