Exemplo n.º 1
0
        /// <inheritdoc/>
        public void Execute(IUndoCommand command)
        {
            #region Sanity checks
            if (command == null) throw new ArgumentNullException(nameof(command));
            #endregion

            command.Execute();
        }
Exemplo n.º 2
0
        public void Execute(IUndoCommand cmd)
        {
            var r = cmd.Execute();

            if (r)
            {
                ++this.CommandCount;
                this.CommandStack.Push(cmd);
            }
        }
Exemplo n.º 3
0
        /// <inheritdoc/>
        public void Execute(IUndoCommand command)
        {
            #region Sanity checks
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }
            #endregion

            command.Execute();
        }
Exemplo n.º 4
0
        public void Redo()
        {
            if (RedoCommands.Count == 0)
            {
                return;
            }

            IUndoCommand cmd = RedoCommands.Pop();

            cmd.Execute();
            UndoCommands.Push(cmd);
            redoCallback();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Adds a command and executes it
 /// </summary>
 /// <param name="command"></param>
 public void Add(IUndoCommand command)
 {
     if (currentCommands == null)
     {
         using (BeginAdd())
             Add(command);
     }
     else
     {
         currentCommands.ModifiedAssemblies.AddRange(GetLoadedAssemblies(command));
         command.Execute();
         OnExecutedOneCommand(currentCommands);
         currentCommands.Commands.Add(command);
     }
 }
Exemplo n.º 6
0
        public void ReverseUndo()
        {
            if (this.reverseStack.Count > 0)
            {
                IUndoCommand command = ReverseStackPopCommand();
                if (command == null)
                {
                    return;
                }

                command.Execute();

                UndoStackPushCommand(command);
            }
        }
Exemplo n.º 7
0
        public void Redo()
        {
            if (mRedoCommands.Count == 0)
            {
                return;
            }

            IUndoCommand cmd = mRedoCommands.Pop();

            cmd.Execute();

            mUndoCommands.Push(cmd);

            TextChangedEvent();
        }
Exemplo n.º 8
0
 public void Add(IUndoCommand command)
 {
     if (currentCommands == null)
     {
         using (BeginAdd())
             Add(command);
     }
     else
     {
         foreach (var o in GetModifiedObjects(command))
         {
             currentCommands.ModifiedObjects.Add(o);
         }
         command.Execute();
         OnExecutedOneCommand(currentCommands);
         currentCommands.Commands.Add(command);
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Adds a command and executes it
 /// </summary>
 /// <param name="command"></param>
 public void Add(IUndoCommand command)
 {
     if (currentCommands == null) {
         using (BeginAdd())
             Add(command);
     }
     else {
         currentCommands.ModifiedObjects.AddRange(GetModifiedObjects(command));
         command.Execute();
         OnExecutedOneCommand(currentCommands);
         currentCommands.Commands.Add(command);
     }
 }
Exemplo n.º 10
0
 public void Execute(object parameter)
 {
     _command.Execute(parameter);
     _undoManager.AddCommand(_command);
 }
Exemplo n.º 11
0
 public void ExecuteCommand(IUndoCommand command)
 {
     command.Execute();
     AddCommand(command);
 }
Exemplo n.º 12
0
		/// <summary>
		/// Adds a command and executes it
		/// </summary>
		/// <param name="command"></param>
		public void Add(IUndoCommand command)
		{
			if (currentCommands == null) {
				using (BeginAdd())
					Add(command);
			}
			else {
				currentCommands.ModifiedAssemblies.AddRange(GetAssemblyTreeNodes(command));
				command.Execute();
				OnExecutedOneCommand(currentCommands);
				currentCommands.Commands.Add(command);
			}
		}
 public void Execute(object parameter)
 {
     _command.Execute(parameter);
     _mgr.AddCommand(_command);
 }