private TreeNode AddOneGroupNode(CameraGroups cg) { TreeNode tn = new TreeNode(); tn.ForeColor = Color.Blue; tn.Text = cg.GroupName; tn.ContextMenuStrip = GroupNodeStrip; tn.Name = NodeType.Group.ToString(); tn.Tag = cg; tvCameras.Nodes[0].Nodes.Add(tn); log.Info("新增分组" + cg.ToString()); return(tn); }
public static TreeNode AddOneGroupNode(CameraGroups cg) { TreeNode tn = new TreeNode(); tn.ForeColor = System.Drawing.Color.Blue; tn.Text = cg.GroupName; tn.Name = NodeType.Group.ToString(); tn.Tag = cg; tn.ToolTipText = cg.GroupName; root.Nodes.Add(tn); log.Info("初始化-加载摄像机分组节点:" + cg.ToString()); return(tn); }
private void deleteGroupNode_Click(object sender, EventArgs e) { TreeNode tn = tvCameras.SelectedNode; if (tn != null && tn.Name == NodeType.Group.ToString()) { //删除子节点 tn.Nodes.Clear(); CameraGroups cg = tn.Tag as CameraGroups; log.Info("删除该分组" + cg.ToString()); tn.Remove(); } log.Info("删除该分组成功"); }