Dispose() 보호된 메소드

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
리턴 void
예제 #1
0
 private void 载入卡组ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DeckSelect DeckSelect = new DeckSelect(this);
     DeckSelect.ShowDialog();
     if (DeckSelect.DialogResult == DialogResult.OK)
     {
         DeckFilename = DeckSelect.SelectedDeckFilename;
         Reset();
         if (AppConfig.GetValue("UseFirsrCardAsHero") == "True")
         {
             HeroNum = 0;
         }
         else
         {
             SelectHero SelectHeroFromDeck = new SelectHero(Player, this);
             SelectHeroFromDeck.ShowDialog();
             if (SelectHeroFromDeck.DialogResult == DialogResult.OK)
             {
                 HeroNum = SelectHeroFromDeck.HeroNum;
             }
             else
             {
                 HeroNum = 0;
             }
             SelectHeroFromDeck.Dispose();
         }
         Renew();
         buttonGameOn.Enabled = true;
         游戏开始ToolStripMenuItem.Enabled = true;
         msgProcessor.Send("SelectDeck", "#载入卡组,共" + Player.Deck.CardList.Count.ToString() + "张卡。");
     }
 }
예제 #2
0
 public void SelectHero()
 {
     if (AppConfig.GetValue("UseFirstCardAsHero") == "True")
     {
         HeroNum = 0;
     }
     else
     {
         SelectHero SelectHeroFromDeck = new SelectHero(Player, this);
         SelectHeroFromDeck.ShowDialog();
         if (SelectHeroFromDeck.DialogResult == DialogResult.OK)
         {
             HeroNum = SelectHeroFromDeck.HeroNum;
         }
         else
         {
             HeroNum = 0;
         }
         SelectHeroFromDeck.Dispose();
     }
 }