Esempio n. 1
0
        //
        ///<summary>
        // Removes all elements from the System.Collections.Generic.List<T>.
        public void Clear()
        {
            UndoRedoArea.AssertCommand();
            Command command = UndoRedoArea.CurrentArea.CurrentCommand;

            if (!command.IsEnlisted(this))
            {
                Enlist(false);
            }
            else
            {
                list.Clear();
            }
        }
        ChangesList Enlist()
        {
            UndoRedoArea.AssertCommand();
            Command command = UndoRedoArea.CurrentArea.CurrentCommand;

            if (!command.IsEnlisted(this))
            {
                ChangesList changes = new ChangesList();
                command[this] = changes;
                return(changes);
            }
            else
            {
                return((ChangesList)command[this]);
            }
        }