Yaircc.MainForm.UserTreeView_MouseDown C# (CSharp) Method

UserTreeView_MouseDown() private method

Handles the MouseDown event of System.Windows.Forms.TreeView.
private UserTreeView_MouseDown ( object sender, MouseEventArgs e ) : void
sender object The source of the event.
e MouseEventArgs The event arguments.
return void
        private void UserTreeView_MouseDown(object sender, MouseEventArgs e)
        {
            TreeView treeView = sender as TreeView;
            TreeViewHitTestInfo info = treeView.HitTest(e.Location);
            treeView.SelectedNode = info.Node;

            if (e.Button == MouseButtons.Right)
            {
                if (this.CurrentTab.TabType == IRCTabType.Channel)
                {
                    if (info.Node != null && info.Node.Tag is IRCUser)
                    {
                        this.whoIsMenuItem.Text = string.Format("Who is {0}?", info.Node.Text);
                        this.whoIsMenuItem.Tag = info.Node.Text;
                        this.whoIsMenuItem.Visible = true;
                        this.mentionUserToolStripMenuItem.Text = string.Format("Mention {0}", info.Node.Text);
                        this.mentionUserToolStripMenuItem.Tag = info.Node.Text;
                        this.mentionUserToolStripMenuItem.Visible = true;
                        this.openPrivateChatMenuItem.Tag = info.Node.Text;
                        this.openPrivateChatMenuItem.Visible = true;
                        this.userSeparator.Visible = true;
                    }
                    else
                    {
                        this.whoIsMenuItem.Visible = false;
                        this.openPrivateChatMenuItem.Visible = false;
                        this.userSeparator.Visible = false;
                        this.mentionUserToolStripMenuItem.Visible = false;
                    }

                    this.groupByModeToolStripMenuItem.Checked = this.CurrentTab.GroupingByMode;
                    this.orderByMenuItem.Enabled = !this.groupByModeToolStripMenuItem.Checked;
                    this.userTreeViewContextMenu.Show(treeView, e.Location);
                }
            }
        }
MainForm