Пример #1
0
 public void SaveSelection()
 {
     SelectionUndoRecord selection = new SelectionUndoRecord(textEdit);
     selection.Next = records;
     records = selection;
 }
Пример #2
0
            public void CloseGroup()
            {
                if (groupStart == null)
                {
                    Debug.Assert(false);
                    throw new InvalidOperationException();
                }

                if (groupStart == records)
                {
                    // delete empty undo group to eliminate no-op entries on user's undo stack
                    records = records.Next;
                    return;
                }

                if (clearRedo)
                {
                    textEdit.redo = null;
                }

                SelectionUndoRecord selection = new SelectionUndoRecord(textEdit);
                selection.Next = records;
                records = selection;

                GroupEndUndoRecord end = new GroupEndUndoRecord(groupStart);
                end.Next = records;
                records = end;

                groupStart = null;
            }