Beispiel #1
0
        public void Setup(EntryRulesEditorWindow window)
        {
            ClearDisposables();

            _window   = window;
            _treeView = window.TreeView;

            _entryRulesService.HasUnsavedChanges.Subscribe(OnUnsavedFlagChanged).DisposeWith(_disposables);
            var rules = _entryRulesService.GetState();

            rules.ObservableAdd.Subscribe(x => OnRuleAdded(x.Value)).DisposeWith(_disposables);
            rules.ObservableRemove.Subscribe(x => OnRuleRemoved(x.Value)).DisposeWith(_disposables);
            rules.ObservableClear.Subscribe(x => OnRuleCleared()).DisposeWith(_disposables);

            foreach (var rule in rules)
            {
                AddTreeViewItem(rule);
            }
        }
Beispiel #2
0
        public void Setup(EntryRulesEditorWindow window)
        {
            ClearDisposables();

            _window   = window;
            _treeView = window.TreeView;

            _window.SaveButtonClickedAsObservable.Subscribe(_ => OnSaveButtonClicked()).DisposeWith(_disposables);
            _window.SaveShortcutExecutedAsObservable.Subscribe(_ => OnSaveShortcutExecuted()).DisposeWith(_disposables);
            _window.OnDisableExecuteAsObservable.Subscribe(_ => OnDisableExecuted()).DisposeWith(_disposables);
            _window.UndoShortcutExecutedAsObservable.Subscribe(_ => Undo());
            _window.RedoShortcutExecutedAsObservable.Subscribe(_ => Redo());
            _window.CreateButtonClickedAsObservable.Subscribe(_ => OnCreateButtonClicked()).DisposeWith(_disposables);
            _window.RightClickCreateMenuClickedAsObservable.Subscribe(_ => OnRightClickCreateMenuClicked())
            .DisposeWith(_disposables);
            _window.RightClickRemoveMenuClickedAsObservable.Subscribe(_ => OnRightClickRemoveMenuClicked())
            .DisposeWith(_disposables);
            _treeView.OnItemAddedAsObservable().Subscribe(OnTreeViewItemAdded).DisposeWith(_disposables);
            _treeView.OnItemRemovedAsObservable().Subscribe(OnTreeViewItemRemoved).DisposeWith(_disposables);
            _treeView.OnItemClearedAsObservable().Subscribe(OnTreeViewItemsCleared).DisposeWith(_disposables);
        }