示例#1
0
        private void TsbAddGroup_Click(object sender, EventArgs e)
        {
            string newGroupName = NewGroupForm.AskFroGroupName(this.persistence);

            if (string.IsNullOrEmpty(newGroupName))
            {
                return;
            }

            FavoritesFactory.GetOrAddNewGroup(this.persistence, newGroupName);
            this.LoadGroups();
        }
示例#2
0
        private void NewGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // backup the selected tree node, because it will be replaced later by focus of NewGroupForm
            GroupTreeNode parentGroupNode = this.favsTree.SelectedGroupNode;
            string        newGroupName    = NewGroupForm.AskFroGroupName(this.persistence);

            if (string.IsNullOrEmpty(newGroupName))
            {
                return;
            }

            IGroup newGroup = this.persistence.Factory.CreateGroup(newGroupName);

            if (parentGroupNode != null)
            {
                newGroup.Parent = parentGroupNode.Group;
            }

            this.persistence.Groups.Add(newGroup);
        }