Example #1
0
 /// <summary>
 /// Adds a new command to the end of this composite command</summary>
 /// <param name="command">Command to add to the end</param>
 public void Add(Command command)
 {
     CompositeCommand compositeCommand = command as CompositeCommand;
     if (compositeCommand != null)
         m_commands.AddRange(compositeCommand.m_commands);
     else
         m_commands.Add(command);
 }
Example #2
0
 /// <summary>
 /// Returns array of all "done" commands and clears the history</summary>
 /// <returns>Array of all done commands</returns>
 public Command[] Collapse()
 {
     // remove any un-done commands
     ClearUndoneCommands();
     Command[] result = new Command[m_commands.Count];
     m_commands.CopyTo(result);
     Clear();
     return result;
 }
Example #3
0
        /// <summary>
        /// Adds a command to the history</summary>
        /// <param name="command">Command to add</param>
        /// <remarks>Use when the command has already been done.</remarks>
        public void Add(Command command)
        {
            if (command == null)
                throw new ArgumentNullException("command");

            // remove any un-done commands
            ClearUndoneCommands();

            Command last = LastDone;
            m_commands.Add(command);
            m_commandCount.Increment();

            OnCommandDone();
        }
 public FileCommandTag(Command command, IDocumentClient client)
 {
     Command = command;
     Editor = client;
 }
Example #5
0
 private bool WrapCommandFunction(Command command, CommandFunction function, bool doing)
 {
     try
     {
         m_currentCommnd = command;
         return function(doing);
     }
     finally
     {
         m_currentCommnd = Command.Invalid;
     }
 }