Beispiel #1
0
        private void btnAddContactGroup_Click(object sender, EventArgs e)
        {
            // добавление группы контактов
            AddressBook.ContactGroup contactGroup = new AddressBook.ContactGroup(LibPhrases.NewContactGroup);
            TreeNode contactGroupNode             = CreateContactGroupNode(contactGroup);

            treeView.Add(rootNode, contactGroupNode);
            contactGroupNode.BeginEdit();
            Modified = true;
        }
Beispiel #2
0
        /// <summary>
        /// Создать узел дерева для группы контактов
        /// </summary>
        private TreeNode CreateContactGroupNode(AddressBook.ContactGroup contactGroup)
        {
            string   imageKey         = contactGroup.Contacts.Count > 0 ? "folder_open.png" : "folder_closed.png";
            TreeNode contactGroupNode = TreeViewUtils.CreateNode(contactGroup, imageKey, true);

            foreach (AddressBook.Contact contact in contactGroup.Contacts)
            {
                contactGroupNode.Nodes.Add(CreateContactNode(contact));
            }

            return(contactGroupNode);
        }