Archived
1
0

Notification system development 2

This commit is contained in:
Michael Gordeev
2018-10-24 22:00:47 +03:00
parent 1a93ea4801
commit df6d9c4aab
5 changed files with 18 additions and 21 deletions
+4 -6
View File
@@ -9,8 +9,7 @@ namespace FoxTube.Classes
{
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; }
@@ -41,20 +40,19 @@ namespace FoxTube.Classes
get
{
if (Type == InboxItemType.PatchNote)
return $"What's new in v{PatchVersion}";
return $"What's new in v{Id}";
else
return Subject;
}
}
public InboxItem(string version, string content, string timeStamp, string id)
public InboxItem(string version, string content, string timeStamp)
{
Type = InboxItemType.PatchNote;
PatchVersion = version;
Content = content;
TimeStamp = DateTime.Parse(timeStamp);
Id = id;
Id = version;
}
public InboxItem(string title, string content, DateTime timeStamp, string id)
+1 -1
View File
@@ -74,7 +74,7 @@ namespace FoxTube
if (settings.Values["ver"] == null)
settings.Values.Add("ver", $"{ver.Major}.{ver.Minor}");
if((string)settings.Values["ver"] == $"{ver.Major}.{ver.Minor}") //Replace for '!=' !!!
//if((string)settings.Values["ver"] != $"{ver.Major}.{ver.Minor}")
{
try
{
+7 -7
View File
@@ -38,21 +38,21 @@ namespace FoxTube
base.OnNavigatedTo(e);
if(!string.IsNullOrWhiteSpace(e.Parameter as string))
{
if ((e.Parameter as string).Contains("inbox"))
if ((e.Parameter as string).Contains("inbox") || (e.Parameter as string).Contains("changelog"))
{
pivot.SelectedIndex = 3;
if ((string)e.Parameter != "inbox")
((pivot.SelectedItem as PivotItem).Content as Inbox).Open((e.Parameter as string).Split('&')[1]);
pivot.SelectedIndex = 2;
if ((string)e.Parameter != "inbox" && (string)e.Parameter != "changelog")
((pivot.SelectedItem as PivotItem).Content as Inbox).Open(e.Parameter as string);
}
else
switch(e.Parameter as string)
{
case "about":
pivot.SelectedIndex = 2;
pivot.SelectedIndex = 1;
break;
case "translate":
/*case "translate":
pivot.SelectedIndex = 3;
break;
break;*/
}
}
}
+3 -4
View File
@@ -45,9 +45,7 @@ namespace FoxTube.Pages.SettingsPages
items.Add(new InboxItem(
e.GetAttribute("version"),
e["content"].InnerText,
e.GetAttribute("time"),
e.GetAttribute("id")
));
e.GetAttribute("time")));
doc.Load("http://foxgame.hol.es/foxtube-messages.xml");
foreach (XmlElement e in doc["posts"].ChildNodes)
@@ -141,8 +139,9 @@ namespace FoxTube.Pages.SettingsPages
}
}
public void Open(string id)
public void Open(string arg)
{
string id = arg.Split('&')[1];
InboxItem item = items.Find(x => x.Id == id);
if(item != null)
list.SelectedIndex = items.IndexOf(item);