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(); //} }
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; })); }
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; }); }
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; })); }
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)); }
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)); }