private DialogResult initializeDlg(NodeDlg dlg) { dlg.Node = mNode; dlg.Text = "Add Node"; /* dlg.ComboBoxGotoSection.DataSource = mProtocol.sectionList();*/ dlg.GotolistBox.DataSource = mProtocol.sectionList(); DialogResult result = dlg.ShowDialog(); return(result); }
private void resetDeleteSectionToolStripItems() { this.mToolStripItemDeleteSection.DropDownItems.Clear(); foreach (string str in mProtocol.sectionList()) { this.mToolStripItemDeleteSection.DropDownItems.Add(str); } foreach (ToolStripDropDownItem item in this.mToolStripItemDeleteSection.DropDownItems) { item.Click += new EventHandler(deleteSectionItem_Click); } mProtocol.Save += new Protocol_old.saveProtocol(saveAndReset); }
public ProtocolStatementUi(Protocol_old protocol, ProtocolNode_old node) { InitializeComponent(); mNodeDlg.GotolistBox.MouseDown += new MouseEventHandler(GotolistBox_MouseDown); mNodeDlg.TextBoxNodeText.DragEnter += new DragEventHandler(mNodeDlg_DragEnter); mNodeDlg.TextBoxNodeText.DragDrop += new DragEventHandler(TextBoxNodeText_DragDrop); mNodeDlg.GotolistBox.MouseDoubleClick += new MouseEventHandler(GotolistBox_MouseDoubleClick); mProtocol = protocol; mNode = node; foreach (string str in mProtocol.sectionList()) { mNodeDlg.GOTOLinkToolStripMenuItem.DropDownItems.Add(str); } initDepthLabel(mNode); // mTextLabel.Text = ""/*mNode.Element.Text*/; if (mNode.Element.SubTextList.Count > 0) { mComboBoxSubText.DataSource = mNode.Element.SubTextList; } else { mComboBoxSubText.Visible = false; } ProtocolItemList pl = new ProtocolItemList(mNode.Element.Text); foreach (ProtocolItem item in pl.mItemList) { switch (item.mType) { case ProtocolItemType.Text: { Label lbl = new Label(); lbl.Click += new EventHandler(lbl_Click); lbl.Text = item.mText; lbl.AutoSize = true; lbl.Margin = new System.Windows.Forms.Padding(0); mFlowLayoutPanel.Controls.Add(lbl); break; } case ProtocolItemType.Link: { LinkLabel lbl = new LinkLabel(); lbl.Text = item.mText; lbl.AutoSize = true; lbl.Margin = new System.Windows.Forms.Padding(0); mFlowLayoutPanel.Controls.Add(lbl); break; } case ProtocolItemType.Question: { mComboBoxSubText.DataSource = mNode.Element.SubTextList; mFlowLayoutPanel.Controls.Add(mComboBoxSubText); break; } default: break; } } }