Example #1
0
        private void mpButtonDelGroup_Click(object sender, EventArgs e)
        {
            GroupSelectionForm dlgGrpSel = new GroupSelectionForm();

            if (dlgGrpSel.ShowDialog(typeof(ChannelGroup), this) != DialogResult.OK)
            {
                return;
            }

            ChannelGroup group = dlgGrpSel.Group as ChannelGroup;

            if (group == null)
            {
                return;
            }

            DialogResult result = MessageBox.Show(string.Format("Are you sure you want to delete the group '{0}'?",
                                                                group.GroupName), "", MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }

            bool isGroupEmpty = (group.ReferringGroupMap().Count <= 0);

            group.Delete();

            if (!isGroupEmpty)
            {
                this.RefreshAll();
            }
            else
            {
                this.RefreshContextMenu();
                this.RefreshTabs();
            }
        }
Example #2
0
        private void mpButtonRenameGroup_Click(object sender, EventArgs e)
        {
            GroupSelectionForm dlgGrpSel = new GroupSelectionForm();

            dlgGrpSel.Selection = GroupSelectionForm.SelectionType.ForRenaming;

            if (dlgGrpSel.ShowDialog(typeof(ChannelGroup), this) != DialogResult.OK)
            {
                return;
            }

            ChannelGroup group = dlgGrpSel.Group as ChannelGroup;

            if (group == null)
            {
                return;
            }

            GroupNameForm dlgGrpName = new GroupNameForm(group.GroupName);

            if (dlgGrpName.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            group.GroupName = dlgGrpName.GroupName;
            group.Persist();

            if (group.ReferringGroupMap().Count > 0)
            {
                this.RefreshAll();
            }
            else
            {
                this.RefreshContextMenu();
                this.RefreshTabs();
            }
        }
Example #3
0
    private void mpButtonDelGroup_Click(object sender, EventArgs e)
    {
      GroupSelectionForm dlgGrpSel = new GroupSelectionForm();

      if (dlgGrpSel.ShowDialog(typeof (ChannelGroup), this) != DialogResult.OK)
      {
        return;
      }

      ChannelGroup group = dlgGrpSel.Group as ChannelGroup;
      if (group == null)
      {
        return;
      }

      DialogResult result = MessageBox.Show(string.Format("Are you sure you want to delete the group '{0}'?",
                                                          group.GroupName), "", MessageBoxButtons.YesNo);

      if (result == DialogResult.No)
      {
        return;
      }

      bool isGroupEmpty = (group.ReferringGroupMap().Count <= 0);

      group.Delete();

      if (!isGroupEmpty)
      {
        this.RefreshAll();
      }
      else
      {
        this.RefreshContextMenu();
        this.RefreshTabs();
      }
    }
Example #4
0
    private void mpButtonRenameGroup_Click(object sender, EventArgs e)
    {
      GroupSelectionForm dlgGrpSel = new GroupSelectionForm();
      dlgGrpSel.Selection = GroupSelectionForm.SelectionType.ForRenaming;

      if (dlgGrpSel.ShowDialog(typeof (ChannelGroup), this) != DialogResult.OK)
      {
        return;
      }

      ChannelGroup group = dlgGrpSel.Group as ChannelGroup;
      if (group == null)
      {
        return;
      }

      GroupNameForm dlgGrpName = new GroupNameForm(group.GroupName);
      if (dlgGrpName.ShowDialog(this) != DialogResult.OK)
      {
        return;
      }

      group.GroupName = dlgGrpName.GroupName;
      group.Persist();

      if (group.ReferringGroupMap().Count > 0)
      {
        this.RefreshAll();
      }
      else
      {
        this.RefreshContextMenu();
        this.RefreshTabs();
      }
    }