Inheritance: IDisposable
コード例 #1
0
 public UpdateProgressViewModel(UpdateManager updateManger,IProductUpdate productUpdate)
 {
     _updateManger = updateManger;
     _productUpdate = productUpdate;
     _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher.CurrentDispatcher);
     StartUpdateProgressTimer();
 }
コード例 #2
0
        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();
            
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 public UpdateUserInterfaceFactory(UpdateManager updateManager)
 {
     _updateManager = updateManager;
 }
コード例 #5
0
 public static Task ApplyUpdateIfAvailableAsync(UpdateManager updateManager)
 {
     var updateTask = updateManager.CheckForUpdatesAsync();
     return updateTask;
 }
コード例 #6
0
 public MainViewModel(UpdateManager updateManager)
 {
     _updateManager = updateManager;
     _userInterfaceFactory = new UpdateUserInterfaceFactory(updateManager);
 }