public UpdateProgressViewModel(UpdateManager updateManger,IProductUpdate productUpdate) { _updateManger = updateManger; _productUpdate = productUpdate; _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher.CurrentDispatcher); StartUpdateProgressTimer(); }
public UpdatePropopsalViewModel(IViewModelInteraction viewModelInteraction ,UpdateManager updateManager, IProductUpdate productUpdate) { if (productUpdate == null) throw new ProductUpdateFailedException(new NullReferenceException("ProductUpdate!")); _viewModelInteraction = viewModelInteraction; _productUpdate = productUpdate; _updateManager = updateManager; _userInterfaceFactory = new UpdateUserInterfaceFactory(_updateManager); ShowUpdateInfo(); }
public static void ApplyUpdateIfAvailable(bool showUpdateUserinterface = true, int maximumSearchTimeout = 5) { using (var updateManager = new UpdateManager(maximumSearchTimeout)) if (showUpdateUserinterface) { try { var userInterfaceFactory = new UpdateUserInterfaceFactory(updateManager); var updateInterfaceWindow = userInterfaceFactory.CreateUpdateWindow(); updateInterfaceWindow.ShowDialog(); } catch (Exception ex) { Debug.WriteLine(ex); } } else { ApplyUpdateIfAvailableAsync(updateManager).Wait(); } }
public UpdateUserInterfaceFactory(UpdateManager updateManager) { _updateManager = updateManager; }
public static Task ApplyUpdateIfAvailableAsync(UpdateManager updateManager) { var updateTask = updateManager.CheckForUpdatesAsync(); return updateTask; }
public MainViewModel(UpdateManager updateManager) { _updateManager = updateManager; _userInterfaceFactory = new UpdateUserInterfaceFactory(updateManager); }