コード例 #1
0
        public override bool CanMerge(DocumentUndoAction action)
        {
            if (!(action is UndoMyEditAction))
                return false;

            var action_casted = (UndoMyEditAction)action;
            if (!(action_casted.__UndoAction is UndoTextEnter))
                return false;

            return __UndoAction.CanBeMergedWith((UndoTextEnter)(action_casted.__UndoAction));
        }
コード例 #2
0
        public override bool CanMerge(DocumentUndoAction action)
        {
            if (!(action is UndoMyEditAction))
            {
                return(false);
            }

            var action_casted = (UndoMyEditAction)action;

            if (!(action_casted.__UndoAction is UndoTextEnter))
            {
                return(false);
            }

            return(__UndoAction.CanBeMergedWith((UndoTextEnter)(action_casted.__UndoAction)));
        }
コード例 #3
0
 public override void Merge(DocumentUndoAction action)
 {
     Debug.Assert(action is UndoMyEditAction);
     Debug.Assert(((UndoMyEditAction)action).__UndoAction is UndoTextEnter);
     __UndoAction.Merge((UndoTextEnter)(((UndoMyEditAction)action).__UndoAction));
 }
コード例 #4
0
 public void Add(DocumentUndoAction action)
 {
     __UndoActions.Add(action);
 }
コード例 #5
0
 public override void Merge(DocumentUndoAction action)
 {
     Debug.Assert(action is UndoMyEditAction);
     Debug.Assert(((UndoMyEditAction)action).__UndoAction is UndoTextEnter);
     __UndoAction.Merge((UndoTextEnter)(((UndoMyEditAction)action).__UndoAction));
 }
コード例 #6
0
ファイル: UndoManager.cs プロジェクト: fednep/UV-Outliner
 public void SaveUndoActionStack(DocumentUndoAction undoAction)
 {
     /*
     var ser = new DataContractSerializer(typeof(DocumentUndoAction));
     using (XmlWriter xw = XmlWriter.Create(Console.Out))
     {
         ser.WriteObject(xw, undoAction);
     }*/
 }
コード例 #7
0
ファイル: UndoManager.cs プロジェクト: fednep/UV-Outliner
        public void PushUndoAction(DocumentUndoAction action)
        {
            // if the action is empty (does not modifies the docuement, skip adding it to the stack
            if (action.IsEmptyAction())
                return;

            SaveUndoActionStack(action);

            if (__UndoActions.Count == 0 || !CanMerge)
            {
                if (__UndoGroup != null)
                    __UndoGroup.Add(action);
                else
                    __UndoActions.Push(action);
            }
            else
            {
                DocumentUndoAction lastAction = __UndoActions.Peek();
                if (lastAction.CanMerge(action))
                    lastAction.Merge(action);
                else
                {
                    if (__UndoGroup != null)
                        __UndoGroup.Add(action);
                    else
                        __UndoActions.Push(action);
                }
            }

            CanMerge = true;
            __RedoActions.Clear();
            DoUndoCountChanged();
        }
コード例 #8
0
 public virtual void Merge(DocumentUndoAction action)
 {
 }
コード例 #9
0
 public virtual bool CanMerge(DocumentUndoAction action)
 {
     return false;
 }
コード例 #10
0
 public virtual void Merge(DocumentUndoAction action)
 {
 }
コード例 #11
0
 public virtual bool CanMerge(DocumentUndoAction action)
 {
     return(false);
 }
コード例 #12
0
ファイル: UndoGroup.cs プロジェクト: fednep/UV-Outliner
 public void Add(DocumentUndoAction action)
 {
     __UndoActions.Add(action);
 }