Beispiel #1
0
        private void CheckIsStrategyChanged()
        {
            if (!DiagramEditorControl.IsChanged)
            {
                return;
            }

            var element = DiagramEditorControl.Composition;

            if (MessageBox.Show("Element {0} was changed. Save?".Put(element.Name), Title, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            {
                _strategiesRegistry.Save(element, _isCompositionSelected);
            }
            else
            {
                _strategiesRegistry.Discard(element, _isCompositionSelected);
            }
        }
Beispiel #2
0
        private void DiscardCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var diagramEditor = (DiagramEditorControl)DockingManager.ActiveContent;
            var item          = diagramEditor.Composition;

            var discardedItem = _strategiesRegistry.Discard(item);

            diagramEditor.Composition = discardedItem;
            diagramEditor.ResetIsChanged();
        }