void OnCheckForUpdatesCompleted(ITask <CheckForUpdatesTask> task) { if (task.IsFaulted) { if (IsCurrentTask(task)) { ReportError(task.Exception); } else { LoggingService.LogInternalError("Check for updates task error.", task.Exception); } } else if (task.IsCancelled) { // Ignore. return; } else if (!IsCurrentTask(task.Result)) { task.Result.Dispose(); return; } else { task.Result.CheckForUpdatesCompleted(); GuiBackgroundDispatch(() => { task.Result.Dispose(); }); } currentCheckForUpdatesTask = null; this.task = null; }
public void Start (CheckForUpdatesTask checkForUpdatesTask) { Stop (); CreateCheckForUpdatesTask (checkForUpdatesTask); task.Start (); }
public void Start(CheckForUpdatesTask checkForUpdatesTask) { Stop(); CreateCheckForUpdatesTask(checkForUpdatesTask); task.Start(); }
void CreateCheckForUpdatesTask(CheckForUpdatesTask checkForUpdatesTask) { currentCheckForUpdatesTask = checkForUpdatesTask; task = taskFactory.CreateTask( () => CheckForUpdates(checkForUpdatesTask), OnCheckForUpdatesCompleted); }
void CreateCheckForUpdatesTask (CheckForUpdatesTask checkForUpdatesTask) { currentCheckForUpdatesTask = checkForUpdatesTask; task = taskFactory.CreateTask ( () => CheckForUpdates (checkForUpdatesTask), OnCheckForUpdatesCompleted); }
public void CheckForUpdates() { GuiDispatch(() => { Clear(); var task = new CheckForUpdatesTask(this, GetProjectsWithPackages()); taskRunner.Start(task); }); }
void CreateCheckForUpdatesTask (CheckForUpdatesTask checkForUpdatesTask) { currentCheckForUpdatesTask = checkForUpdatesTask; checkForUpdatesTask.ProgressMonitor = CreateProgressMonitor (); task = taskFactory.CreateTask ( () => CheckForUpdates (checkForUpdatesTask), OnCheckForUpdatesCompleted); }
void ReportError(Exception ex) { CheckForUpdatesTask task = currentCheckForUpdatesTask; task.ReportError(ex); GuiBackgroundDispatch(() => { task.Dispose(); }); }
void CreateCheckForUpdatesTask(CheckForUpdatesTask checkForUpdatesTask) { currentCheckForUpdatesTask = checkForUpdatesTask; checkForUpdatesTask.ProgressMonitor = CreateProgressMonitor(); task = taskFactory.CreateTask( () => CheckForUpdates(checkForUpdatesTask), OnCheckForUpdatesCompleted); }
public void CheckForUpdatesCompleted(CheckForUpdatesTask task) { projectsWithUpdatedPackages = task.ProjectsWithUpdatedPackages.ToList(); RemovePackagesUpdatedDuringCheckForUpdates(); if (AnyUpdates()) { packageManagementEvents.OnUpdatedPackagesAvailable(); } }
public void Stop () { if (task != null) { task.Cancel (); task = null; } if (currentCheckForUpdatesTask != null) { currentCheckForUpdatesTask.Dispose (); currentCheckForUpdatesTask = null; } }
public void Stop() { if (task != null) { task.Cancel (); task = null; } if (currentCheckForUpdatesTask != null) { currentCheckForUpdatesTask.Dispose (); currentCheckForUpdatesTask = null; } }
bool IsCurrentTask (CheckForUpdatesTask task) { return currentCheckForUpdatesTask == task; }
CheckForUpdatesTask CheckForUpdates (CheckForUpdatesTask currentTask) { currentTask.CheckForUpdates (); return currentTask; }
bool IsCurrentTask(CheckForUpdatesTask task) { return(currentCheckForUpdatesTask == task); }
void OnCheckForUpdatesCompleted (ITask<CheckForUpdatesTask> task) { if (task.IsFaulted) { if (IsCurrentTask (task)) { ReportError (task.Exception); } else { LoggingService.LogInternalError ("Check for updates task error.", task.Exception); } } else if (task.IsCancelled) { // Ignore. return; } else if (!IsCurrentTask (task.Result)) { task.Result.Dispose (); return; } else { task.Result.CheckForUpdatesCompleted (); GuiBackgroundDispatch (() => { task.Result.Dispose (); }); } currentCheckForUpdatesTask = null; this.task = null; }
CheckForUpdatesTask CheckForUpdates(CheckForUpdatesTask currentTask) { currentTask.CheckForUpdates(); return(currentTask); }