/// <summary> /// Create a deep copy of this ManagerMacro /// </summary> /// <returns>ManagerMacro object that is a deep copy of this one</returns> public override TextPart Clone() { ManagerMacro mMacro = new ManagerMacro(); mMacro.DesignText.Clear(); foreach(TextPart part in DesignText) { mMacro.DesignText.Add(part.Clone()); } mMacro.NoManagerText.Clear(); foreach(TextPart part in NoManagerText) { mMacro.NoManagerText.Add(part.Clone()); } return mMacro; }
/// <summary> /// Executed event handler for the InsertManagerMacroBefore menu item /// </summary> /// <param name="sender">not used</param> /// <param name="e">not used</param> private void OnInsertManagerMacroBeforeCommand_Executed(object sender, ExecutedRoutedEventArgs e) { // create a new ManagersMacro object and add it to the TextItems. ManagerMacro mMacro = new ManagerMacro(); int position = GetPosition(); if(position != -1) { PartItems.Insert(position, mMacro); UpdateDialog(); // redraw the Dialog contents } }