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