private void treeView_AfterSelect(object sender, TreeViewEventArgs e) { _parentForm.ShowMessage(""); SelectedTestNode = null; SelectedGroupNode = null; if (e.Node.Text == TestGroup.UNKNOWN_GROUP) { _parentForm.ShowMessage(string.Format("Please rename the [{0}] group.", TestGroup.UNKNOWN_GROUP), true); SelectedGroupNode = e.Node; SelectedGroupNode.BeginEdit(); return; } if (e.Node != _rootNode && e.Node.Parent == _rootNode) { SelectedGroupNode = e.Node; splitContainer1.Panel1.Controls.Clear(); _parentForm.ShowMessage(string.Format("{0} group is selected.", SelectedGroupNode.Text)); } else if (e.Node != _rootNode) { SelectedTestNode = e.Node; SelectedGroupNode = e.Node.Parent; AddTestControl(SelectedTestNode.Tag as Test); } }
private void onImgAddClick(object sender, EventArgs e) { if (null != _rootNode) { _parentForm.ShowMessage(""); var healthCheck = _rootNode.Tag as HealthCheck; var testGroup = healthCheck.InsertNewTestGroup(); if (null != testGroup) { var groupNode = new TreeNode(testGroup.key); groupNode.Tag = testGroup; SelectedGroupNode = groupNode; _rootNode.Nodes.Add(groupNode); splitContainer1.Panel1.Controls.Clear(); SelectedGroupNode.BeginEdit(); } else { _parentForm.ShowMessage(healthCheck.errorMessage, true); } } else { _parentForm.ShowMessage("Please load a Json file.", true); } }