public AddMacroCommandAction(IMacro macro, IMacroCommand command) { m_Macro = macro; m_MacroElement = macro.AddElement(command); m_Index = macro.GetElements().Count - 1; macro.RemoveElement(m_MacroElement.Id); }
public ReplaceMacroCommandAction(IMacro macro, int oldCommandId, IMacroCommand newCommand) { m_Macro = macro; m_OldElement = macro.GetElement(oldCommandId); IList <IMacroElement> elements = m_Macro.GetElements(); for (int i = 0; i < elements.Count; ++i) { if (elements[i] == m_OldElement) { m_Index = i; break; } } m_NewElement = macro.AddElement(newCommand); macro.RemoveElement(m_NewElement.Id); }