/// <summary> /// Enables the user to check/uncheck nodes using the space keyboard key. /// </summary> /// <param name="sender">Event sender object.</param> /// <param name="e">Event arguments.</param> private void trvFeatures_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { if (trvFeatures != null && trvFeatures.SelectedNode != null) { FeatureModelTreeNode selectedNode = trvFeatures.SelectedNode as FeatureModelTreeNode; selectedNode.Click(); } } }
/// <summary> /// Checks/unchecks a Confeaturator node and perform related actions, unless the /// click happened as a result collapsing/expanding the node. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void trvFeatures_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (!(e.Node as FeatureModelTreeNode).IsCollapsingOrExpanding) { if (e.Button == MouseButtons.Left) { FeatureModelTreeNode node = e.Node as FeatureModelTreeNode; node.Click(); } } (e.Node as FeatureModelTreeNode).IsCollapsingOrExpanding = false; }