Notification system development 2
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user