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