// Inserts a new group after the last selected group public void InsertAfterInstructionGroup(IInstructionGroupItem groupFactory) { if (runtimeService.DisconnectDialog(this)) { IInstructionGroupItem foundIG = null; foreach (var instructionGroupIterator in Items) { IInstructionGroupItem instructionGroup = null; instructionGroup = instructionGroupIterator as IInstructionGroupItem; if (instructionGroup != null && instructionGroup.IsSelected) { foundIG = instructionGroup; } } if (foundIG != null) { var newItem = groupFactory.Create(this, null); NodePage newPage = WorkingCopy.NodeInstructionGroupChildren.InsertAfter(foundIG.InstructionGroup, newItem.InstructionGroup); insertNewGroup(newItem, newPage); } else { PageEditorParent.messagingService.ShowMessage( Resources.Strings.PageEditor_GroupCommand_NoneSelected, Resources.Strings.PageEditor_GroupCommand_NoneSelected_Title); } } }
public void AppendInstructionGroup(IInstructionGroupItem groupFactory) { if (runtimeService.DisconnectDialog(this)) { var newItem = groupFactory.Create(this, null); NodePage newPage = WorkingCopy.NodeInstructionGroupChildren.Append(newItem.InstructionGroup); insertNewGroup(newItem, newPage); } }