コード例 #1
0
        private void RemoveSelRows()
        {
            try
            {
                if (CurrentProject is IRowColumnAddableDeletable)
                {
                    if (selectedDominoes.Count > 0)
                    {
                        DeleteRows deleteRows = new DeleteRows((CurrentProject as IRowColumnAddableDeletable), selectedDominoes.ToArray());
                        ClearCanvas();
                        ExecuteOperation(deleteRows);

                        DisplaySettingsTool.ResetCanvas();
                    }
                }
                else
                {
                    Errorhandler.RaiseMessage("Could not remove a row in this project.", "Remove Row", Errorhandler.MessageType.Warning);
                }
            }
            catch (InvalidOperationException ex)
            {
                Errorhandler.RaiseMessage(ex.Message, "Error", Errorhandler.MessageType.Error);
            }
        }
コード例 #2
0
        public void RedoInternal(bool IncludeSelectionOperation = false)
        {
            if (redoStack.Count == 0)
            {
                return;
            }
            PostFilter redoFilter;

            do
            {
                redoFilter = redoStack.Pop();
                undoStack.Push(redoFilter);
                redoFilter.Apply();
            } while ((!IncludeSelectionOperation && redoFilter is SelectionOperation) && redoStack.Count != 0);

            if (!(redoFilter is EditingDeactivatedOperation || redoFilter is SelectionOperation || redoFilter is SetColorOperation))
            {
                ClearCanvas(false);
                DisplaySettingsTool.ResetCanvas();
            }
            else
            {
                UpdateUIElements();
            }
        }
コード例 #3
0
        private void AddColumn(bool addRight)
        {
            try
            {
                if (selectedDominoes.Count > 0)
                {
                    int selDomino = selectedDominoes.First();
                    if (CurrentProject is IRowColumnAddableDeletable)
                    {
                        AddColumns addRows = new AddColumns((CurrentProject as IRowColumnAddableDeletable), selDomino, 1, dominoTransfer[selDomino].color, addRight);
                        ClearCanvas();
                        ExecuteOperation(addRows);

                        DisplaySettingsTool.ResetCanvas();
                        SelectionTool.Select(addRows.added_indizes, true);
                        UpdateUIElements();
                    }
                    else
                    {
                        Errorhandler.RaiseMessage("Could not add a row in this project.", "Add Row", Errorhandler.MessageType.Warning);
                    }
                }
            }
            catch (InvalidOperationException ex)
            {
                Errorhandler.RaiseMessage(ex.Message, "Error", Errorhandler.MessageType.Error);
            }
        }
コード例 #4
0
        public void UndoInternal(bool IncludeSelectionOperation = false)
        {
            if (undoStack.Count == 0)
            {
                return;
            }
            PostFilter undoFilter;

            do
            {
                undoFilter = undoStack.Pop();
                redoStack.Push(undoFilter);
                undoFilter.Undo();
            } while ((!IncludeSelectionOperation && (undoFilter is SelectionOperation)) && (undoStack.Count != 0));

            if (!(undoFilter is EditingActivatedOperation || undoFilter is SelectionOperation || undoFilter is SetColorOperation))
            {
                ClearCanvas(false);
                DisplaySettingsTool.ResetCanvas();
                if (undoStack.Count == 0)
                {
                    UnsavedChanges = false;
                }
            }
            else
            {
                UpdateUIElements();
            }
        }