private void bDelete_Click( object sender, EventArgs e ) {
if( treeData.SelectedNode.Nodes.Count > 0 ) {
DialogResult result = MessageBox.Show( "Delete this group and all of its conditions?", "",
MessageBoxButtons.OKCancel );
if( result != DialogResult.OK ) return;
}
TreeNode parent = treeData.SelectedNode.Parent;
treeData.SelectedNode.Remove();
if( parent != null ) {
treeData.SelectedNode = parent;
((GroupNode)parent).UpdateLabel();
} else {
gEditGroup.Visible = false;
gEditAction.Visible = false;
gEditCondition.Visible = false;
}
}