小弟新人,下边的代码不理解,请大神予以指点,尤其是红色部分。多谢!!!
private void 增加ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (dataForm == null)
{
dataForm = new DataForm();
dataForm.DataPanelSelected += panelSelected;
dataForm.WindowState = FormWindowState.Maximized;
dataForm.MdiParent = this;
dataForm.Visible = true;
}
dataForm.AddDataPanel();
}
private void panelSelected(object sender, DataPanel panel)
{
if (treeView1.Nodes.Count > 0)
{
recursiveSelect(treeView1.Nodes[0], panel.CurveDescriptions);
}
}
private void recursiveSelect(
TreeNode node, List<string> list)
{
if (list == null) return;
if (node.Nodes.Count == 0)
{
if (list.Contains(node.Text) && !node.Checked)
node.Checked = true;
else if (!list.Contains(node.Text) && node.Checked)