Archived
1
0

Notifications foreground processing

This commit is contained in:
Michael Gordeev
2018-10-25 17:13:37 +03:00
parent df6d9c4aab
commit 3126b9cf19
3 changed files with 23 additions and 18 deletions
+15 -14
View File
@@ -1,26 +1,13 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Globalization;
using Windows.Storage;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace FoxTube
@@ -123,7 +110,21 @@ namespace FoxTube
Methods.MainPage.GoToDeveloper(args[1]);
break;
//TODO: The rest
case "video":
Methods.MainPage.GoToVideo(args[1]);
break;
case "dcancel":
Methods.MainPage.Agent.Remove(args[1]);
break;
case "channel":
Methods.MainPage.GoToChannel(args[1]);
break;
case "later":
//Add to WL playlist
break;
}
}
+7 -1
View File
@@ -41,7 +41,13 @@ namespace FoxTube.Controls
public void Remove(string id)
{
items.Remove(items.Find(x => x.Container.Id == id));
DownloadItem item = items.Find(x => x.Container.Id == id);
if (item == null)
return;
if (item.InProgress)
item.cancel_Click(this, null);
else
items.Remove(item);
}
public async void QuitPrompt()
+1 -3
View File
@@ -2,7 +2,6 @@
using System.IO;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using System.Net;
using Windows.UI.Xaml.Media.Imaging;
using Windows.System;
using FoxTube.Classes;
@@ -14,7 +13,6 @@ using System.Threading;
using System.Xml;
using Windows.UI.Popups;
using Windows.Storage.Pickers;
using System.Diagnostics;
using Windows.UI.Notifications;
using Microsoft.Toolkit.Uwp.Notifications;
@@ -196,7 +194,7 @@ namespace FoxTube.Controls
Methods.MainPage.Agent.Remove(Container.Id);
}
private async void cancel_Click(object sender, RoutedEventArgs e)
public async void cancel_Click(object sender, RoutedEventArgs e)
{
if(InProgress)
{