Beispiel #1
0
 //Add custom draw to list view to draw all subitems in a single column.
 private void btnAddMember_Click(object sender, EventArgs e)
 {
     if (txtMemberName.Text != String.Empty &&
         !lstvwClassMembers.Items.ContainsKey(txtMemberName.Text))
     {
         MemberInfo info = new MemberInfo();
         info.Text = info.Name = txtMemberName.Text;
         foreach (TreeNode node in trParsedURL.Nodes)
             GetCheckedNodes(ref info.Nodes, node);
         info.UpdateSubInfo();
         lstvwClassMembers.Items.Add(info);
         txtMemberName.Text = "";
         foreach (TreeNode node in info.Nodes)
             node.Checked = false;
     }
 }
        //Add custom draw to list view to draw all subitems in a single column.
        private void btnAddMember_Click(object sender, EventArgs e)
        {
            List<TreeNode> nodeList = new List<TreeNode>();
            parent.GetCheckedNodes(ref nodeList);
            if (nodeList.Count == 0)
            {
                MessageBox.Show("Please select a node from the Parsed URL tree");
                return;
            }
            MemberInfo info = new MemberInfo();
            MemberForm memberForm = new MemberForm(ref info, nodeList);

            if (memberForm.ShowDialog() == DialogResult.OK)
            {
                lstvwClassMembers.Items.Add(info);
                foreach (TreeNode node in nodeList)
                    info.Nodes.Add(node);
                info.UpdateSubInfo();
            }

            parent.UncheckAll();
        }