예제 #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);
        }