상속: 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(); });
        }