Example #1
0
        private void ShowNewGroupDialog()
        {
            SessionGroupOptionsDialog dlg = new SessionGroupOptionsDialog();

            dlg.DialogTitle  = "New Group";
            dlg.OKButtonText = "Add Group";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                SessionGroup group = new SessionGroup(dlg.GroupName);
                TreeNode     node  = new TreeNode(group.Name);
                node.Tag = group;
                sessionsNode.Nodes.Add(node);
                SaveGroupsAndSessions();
            }
        }
Example #2
0
        private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ctxMenuSessionGroup.Tag is TreeNode && ctxMenuSessionGroup.Tag != sessionsNode)
            {
                TreeNode     groupNode = (TreeNode)ctxMenuSessionGroup.Tag;
                SessionGroup group     = (SessionGroup)groupNode.Tag;

                SessionGroupOptionsDialog dlg = new SessionGroupOptionsDialog();
                dlg.DialogTitle  = "Edit Group";
                dlg.OKButtonText = "Ok";
                dlg.GroupName    = group.Name;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    group.Name     = dlg.GroupName;
                    groupNode.Text = dlg.GroupName;
                    SaveGroupsAndSessions();
                }
            }
        }