private void m_lblLink2_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { if (m_obj2 != null) { m_linkJump = m_obj2 as FwLink; m_linkCmd = m_obj2 as ChooserCommand; if (m_linkJump != null) { btnCancel.PerformClick(); // No result as such, but we'll perform a jump. this.DialogResult = DialogResult.Ignore; } else if (m_linkCmd != null) { btnOK.PerformClick(); } else { Debug.Assert(m_linkJump != null && m_linkCmd != null); } } }
/// -------------------------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="T:ChooserCommandNode"/> class. /// </summary> /// <param name="cmd">The CMD.</param> /// -------------------------------------------------------------------------------- public ChooserCommandNode(ChooserCommand cmd) : base() { this.Tag = cmd; this.Text = cmd.Label; }
/// <summary> /// </summary> /// <param name="cmd"></param> public void AddChooserCommand(ChooserCommand cmd) { CheckDisposed(); ChooserCommandNode node = new ChooserCommandNode(cmd); string sFontName = cmd.Cache.LangProject.DefaultAnalysisWritingSystemFont; // TODO: need to get analysis font's size // and then set it to use underline: Font font = new Font(sFontName, 10.0f, FontStyle.Italic); node.NodeFont = font; //node.ForeColor = Color.DarkGreen; m_labelsTreeView.Nodes.Insert(0, node); }