GUI/Controls/TreeViewWithSearchResults.cs
/// <summary>
/// If the user double clicks (with left mouse button) on a ListViewItem, send up an event to subscribers that such an action has occurred. Also send up
/// whatever object is represented by the ListViewItem.
/// </summary>
/// <param name="sender">Object which raised event.</param>
/// <param name="e">Event data.</param>
If the user double clicks (with left mouse button) on a ListViewItem, send up an event to subscribers that such an action has occurred. Also send up
whatever object is represented by the ListViewItem.
If the user double clicks ( with left mouse button ) on a ListViewItem send up an event to subscribers that such an action has occurred . Also send up whatever object is represented by the ListViewItem .
private void MainListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                var info = mainListView.HitTest(e.X, e.Y);
                if (info.Item != null)
                {
                    var node = info.Item.Tag as TreeNode;
                    if (node.Tag is TreeViewFolder)
                    {
                        mainListView.Items.Clear();
                        foreach (TreeNode childNode in node.Nodes)
                        {
                            AddNodeToListView(childNode);
                        }
                    }
                    ListViewItemDoubleClick?.Invoke(sender, new ListViewItemClickEventArgs(info.Item.Tag));
                }
                else
                {
                    mainListView.SelectedItems.Clear();
                }
            }
        }
private void MainListView_MouseDoubleClick ( object sender , MouseEventArgs e ) { if ( e . Button == MouseButtons . Left ) { var info = mainListView . HitTest ( e . X , e . Y ) ; if ( info . Item != null ) { var node = info . Item . Tag as TreeNode ; if ( node . Tag is TreeViewFolder ) { mainListView . Items . Clear ( ) ; foreach ( TreeNode childNode in node . Nodes ) { AddNodeToListView ( childNode ) ; } } ListViewItemDoubleClick ? . Invoke ( sender , new ListViewItemClickEventArgs ( info . Item . Tag ) ) ; } else { mainListView . SelectedItems . Clear ( ) ; } } }
If the user double clicks (with left mouse button) on a ListViewItem, send up an event to subscribers that such an action has occurred.
If the user double clicks ( with left mouse button ) on a ListViewItem send up an event to subscribers that such an action has occurred .
// if user left double clicks a folder, open its contents and display in list view
sender
object
Object which raised event.
Object which raised event .
e
MouseEventArgs
None