Наследование: ReactiveUI.ReactiveObject
Пример #1
0
        public MainWindowViewModel()
        {
            Editor   = new NitraTextEditorViewModel(this);
            Settings = Settings.Default;

            var canFindSymbolDefinitions = this.WhenAny(v => v.CurrentSuite, v => v.CurrentFile,
                                                        (suite, test) => suite != null && test != null);

            FindSymbolDefinitions = ReactiveCommand.Create(canFindSymbolDefinitions);
            FindSymbolDefinitions.ThrownExceptions.Subscribe(e =>
                                                             StatusText = "GOTO definition failed!");
            FindSymbolDefinitions.Subscribe(OnFindSymbolDefinitions);

            FindSymbolReferences = ReactiveCommand.Create(canFindSymbolDefinitions);
            FindSymbolReferences.ThrownExceptions.Subscribe(e =>
                                                            StatusText = "Find all references definition failed!");
            FindSymbolReferences.Subscribe(OnFindSymbolReferences);

            Changing.Where(c => c.PropertyName == "Workspace")
            .Subscribe(_ => { if (Workspace != null)
                              {
                                  Workspace.Dispose();
                              }
                       });
        }
Пример #2
0
        public IntelliSensePopupViewModel(NitraTextEditorViewModel editor)
        {
            Items = new ReactiveList <PopupItemViewModel>();

            var canSelect = this.WhenAny(v => v.SelectedPopupItem, item => item.Value != null);

            Select = ReactiveCommand.Create(canSelect);
            Select.Subscribe(_ => {
                editor.SelectText(SelectedPopupItem.File, SelectedPopupItem.Span);

                IsVisible         = false;
                SelectedPopupItem = null;
            });
        }
Пример #3
0
    public IntelliSensePopupViewModel(NitraTextEditorViewModel editor)
    {
      Items = new ReactiveList<PopupItemViewModel>();

      var canSelect = this.WhenAny(v => v.SelectedPopupItem, item => item.Value != null);

      Select = ReactiveCommand.Create(canSelect);
      Select.Subscribe(_ => {
        editor.SelectText(SelectedPopupItem.File, SelectedPopupItem.Span);

        IsVisible = false;
        SelectedPopupItem = null;
      });
    }
Пример #4
0
        public MainWindowViewModel()
        {
            Editor   = new NitraTextEditorViewModel(this);
            Settings = Settings.Default;

            var canFindSymbolDefinitions = this.WhenAny(v => v.CurrentSuite, v => v.CurrentTest,
                                                        (suite, test) => suite != null && test != null);

            FindSymbolDefinitions = ReactiveCommand.Create(canFindSymbolDefinitions);
            FindSymbolDefinitions.ThrownExceptions.Subscribe(e =>
                                                             StatusText = "GOTO definition failed!");
            FindSymbolDefinitions.Subscribe(OnFindSymbolDefinitions);

            FindSymbolReferences = ReactiveCommand.Create(canFindSymbolDefinitions);
            FindSymbolReferences.ThrownExceptions.Subscribe(e =>
                                                            StatusText = "Find all references definition failed!");
            FindSymbolReferences.Subscribe(OnFindSymbolReferences);
        }
Пример #5
0
        public MainWindowViewModel()
        {
            Editor = new NitraTextEditorViewModel(this);
              Settings = Settings.Default;

              var canFindSymbolDefinitions = this.WhenAny(v => v.CurrentSuite, v => v.CurrentFile,
                                                  (suite, test) => suite != null && test != null);

              FindSymbolDefinitions = ReactiveCommand.Create(canFindSymbolDefinitions);
              FindSymbolDefinitions.ThrownExceptions.Subscribe(e =>
            StatusText = "GOTO definition failed!");
              FindSymbolDefinitions.Subscribe(OnFindSymbolDefinitions);

              FindSymbolReferences = ReactiveCommand.Create(canFindSymbolDefinitions);
              FindSymbolReferences.ThrownExceptions.Subscribe(e =>
            StatusText = "Find all references definition failed!");
              FindSymbolReferences.Subscribe(OnFindSymbolReferences);

              Changing.Where(c => c.PropertyName == "Workspace")
            .Subscribe(_ => { if (Workspace != null) Workspace.Dispose(); });
        }