Esempio n. 1
0
        public static int RunTask(NavigationFriendlyPage page, AppTask task)
        {
            int id = CurrentID++;
            Tuple <NavigationFriendlyPage, int, IAsyncAction, AppTask> item = new Tuple <NavigationFriendlyPage, int, IAsyncAction, AppTask>(page, id, ThreadPool.RunAsync(task.GetWorkItemHandler(page.Dispatcher)), task);

            return(id);
        }
Esempio n. 2
0
 public static int RunTask(NavigationFriendlyPage page, AppTask task)
 {
     int id = CurrentID++;
     Tuple<NavigationFriendlyPage, int, IAsyncAction, AppTask> item = new Tuple<NavigationFriendlyPage, int, IAsyncAction, AppTask>(page, id, ThreadPool.RunAsync(task.GetWorkItemHandler(page.Dispatcher)), task);
     
     return id;
 }
Esempio n. 3
0
 public static void CancelPage(NavigationFriendlyPage page)
 {
     var targets = from task in RunningTasks where task.Item1 == page select task;
     foreach (var task in targets)
     {
         task.Item3.Cancel();
         RunningTasks.Remove(task);
     }
 }
Esempio n. 4
0
        public static void CancelPage(NavigationFriendlyPage page)
        {
            var targets = from task in RunningTasks where task.Item1 == page select task;

            foreach (var task in targets)
            {
                task.Item3.Cancel();
                RunningTasks.Remove(task);
            }
        }