Inheritance: IPartImportsSatisfiedNotification
        public MainWindowViewModel(AutoCompleteBasedOnLucene autoCompleteText, IGetActionsForItem getActionsForItem,
            Logger log, UpdateManagerAdapter updateManager, IWindowManager windowManager,
            Shutdown shutdown)
        {
            _autoCompleteText = autoCompleteText;
            _getActionsForItem = getActionsForItem;
            _log = log;

            _updateManager = updateManager;
            _windowManager = windowManager;
            _shutdown = shutdown;
            _updateManager.UpdatesAvailable += (sender, args) =>
            {
                {
                    Status.SetMessage(this, "Update available, downloading");
                    _updateManager.PrepareUpdates();
                }
            };
            _updateManager.UpdatesReady += (sender, args) =>
            {
                Status.SetMessage(this, "Update prepared, ready for install");
                NotifyOfPropertyChange(() => UpdateVisible);
                NotifyOfPropertyChange(() => CanUpdate);
            };

            _cancelationTokenSource = new CancellationTokenSource();
            _argumentCancelationTokenSource = new CancellationTokenSource();
            CommandOptions =
                new ListWithCurrentSelection<AutoCompletionResult.CommandResult>(
                    new AutoCompletionResult.CommandResult(new TextItem(string.Empty), null));
            ArgumentOptions = new ListWithCurrentSelection<string>();
            Result = CommandOptions.Current;
        }
Beispiel #2
0
 public override void Act()
 {
     Status.SetMessage(this, "Checking for updates");
     UpdateManagerAdapter.CheckForUpdates();
 }