Пример #1
0
        public void ExecuteWrapper()
        {
            // C# way
            if (ProgressTask == null || ProgressTask.Status == TaskStatus.RanToCompletion)
            {
                ProgressTask = CreateTask();
                ProgressTask.Start();
            }
            else
            {
                CancelToken.Cancel();
                ProgressTask.Wait();
                object val = ProgressTask.Result;
                ProgressTask = null;
            }

            // Android way
            //if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb)
            //{
            //    ExecuteOnExecutor(AsyncTask.ThreadPoolExecutor);
            //}
            //else
            //{
            //    Execute();
            //}
        }
Пример #2
0
        public override IProgressTask <float, T> LoadWindowAsync <T>(IWindowManager windowManager, string name)
        {
            ProgressTask <float, T> task = new ProgressTask <float, T>(p => DoLoad <T>(p, name));

            return(task.Start(30).OnPostExecute(win =>
            {
                win.WindowManager = windowManager;
            }));
        }
Пример #3
0
        public override IProgressTask<float, T> LoadWindowAsync<T>(IWindowManager windowManager, string name)
        {
            if (windowManager == null)
                windowManager = this.GetDefaultWindowManager();

            ProgressTask<float, T> task = new ProgressTask<float, T>(p => DoLoad<T>(p, name));
            return task.Start(30).OnPostExecute(win =>
            {
                win.WindowManager = windowManager;
            });
        }
Пример #4
0
        public virtual IProgressTask <float, T> LoadWindowAsync <T> (IWindowManager windowManager, string name) where T : Window
        {
            if (windowManager == null)
            {
                windowManager = this.GetDefaultWindowManager();
            }

            ProgressTask <float, T> task = new ProgressTask <float, T> (p => DoLoad <T> (p, name));

            return(task.Start(30).OnPostExecute(win => {
                win.WindowManager = windowManager;
            }));
        }
Пример #5
0
    public override IProgressTask <float, T> LoadViewAsync <T>(string name)
    {
        ProgressTask <float, T> task = new ProgressTask <float, T>(p => DoLoad <T>(p, name));

        return(task.Start(30));
    }
Пример #6
0
        public virtual IProgressTask <float, T> LoadViewAsync <T> (string name) where T : IView
        {
            ProgressTask <float, T> task = new ProgressTask <float, T> (p => DoLoad <T> (p, name));

            return(task.Start(30));
        }