private void MenuGroup_Delete_Click(object sender, EventArgs e)
        {
            ImageLabel senderLabel = MenuGroup.SourceControl as ImageLabel;

            if (senderLabel == null)
            {
                return;                         //想定外
            }
            ShipGroupData group = KCDatabase.Instance.ShipGroup[(int)senderLabel.Tag];

            if (group != null && group.GroupID >= 0)
            {
                if (MessageBox.Show(string.Format("グループ [{0}] を削除しますか?\r\nこの操作は元に戻せません。", group.Name), "確認",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
                    == System.Windows.Forms.DialogResult.Yes)
                {
                    if (SelectedTab == senderLabel)
                    {
                        ShipView.Rows.Clear();
                        SelectedTab = null;
                    }
                    KCDatabase.Instance.ShipGroup.ShipGroups.Remove(group);
                    TabPanel.Controls.Remove(senderLabel);
                    senderLabel.Dispose();
                }
            }
            else
            {
                MessageBox.Show("このグループは削除できません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
示例#2
0
 public void Dispose()
 {
     Name.Dispose();
     ActionKind.Dispose();
     AirSuperiority.Dispose();
     Distance.Dispose();
     Squadrons.Dispose();
 }
示例#3
0
 public void Dispose()
 {
     Name.Dispose();
     foreach (var ship in Ships)
     {
         ship.Dispose();
     }
 }
示例#4
0
 public void Dispose()
 {
     Number.Dispose();
     State.Dispose();
 }
示例#5
0
 public void Dispose()
 {
     ShipName.Dispose();
     Equipments.Dispose();
 }
        void ReleaseDesignerOutlets()
        {
            if (FinishedButton != null)
            {
                FinishedButton.Dispose();
                FinishedButton = null;
            }

            if (ImageCountLabel != null)
            {
                ImageCountLabel.Dispose();
                ImageCountLabel = null;
            }

            if (ImageLabel != null)
            {
                ImageLabel.Dispose();
                ImageLabel = null;
            }

            if (imageStackLabel != null)
            {
                imageStackLabel.Dispose();
                imageStackLabel = null;
            }

            if (ImageViewSession != null)
            {
                ImageViewSession.Dispose();
                ImageViewSession = null;
            }

            if (IndependentButton != null)
            {
                IndependentButton.Dispose();
                IndependentButton = null;
            }

            if (LeftArrow != null)
            {
                LeftArrow.Dispose();
                LeftArrow = null;
            }

            if (MissedButton != null)
            {
                MissedButton.Dispose();
                MissedButton = null;
            }

            if (PromptedButton != null)
            {
                PromptedButton.Dispose();
                PromptedButton = null;
            }

            if (RightArrow != null)
            {
                RightArrow.Dispose();
                RightArrow = null;
            }

            if (StatsLabel != null)
            {
                StatsLabel.Dispose();
                StatsLabel = null;
            }
        }