Beispiel #1
0
        /// <summary>
        /// Form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DungeonForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            DrawTimer.Stop();

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

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

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

            if (CheckerBoard != null)
            {
                CheckerBoard.Dispose();
            }
            CheckerBoard = null;
        }
Beispiel #2
0
        /// <summary>
        /// Form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ParentForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DrawTimer.Stop();

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

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

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