Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void
Exemplo n.º 1
0
        private void ConnectOfflineGameDialogOnClose(object o, DialogResult dialogResult)
        {
            BorderButtons.IsEnabled = true;
            try
            {
                if (dialogResult == DialogResult.OK)
                {
                    if (connectOfflineGameDialog.Successful)
                    {
                        if (WindowManager.PlayWindow == null)
                        {
                            //WindowManager.PreGameLobbyWindow = new PreGameLobbyWindow();
                            //WindowManager.PreGameLobbyWindow.Setup(true, WindowManager.Main);
                            WindowManager.PlayWindow = new PlayWindow();
                            WindowManager.PlayWindow.Show();
                            return;
                        }
                    }
                }

                try
                {
                    Program.GameEngine.End();
                }
                catch { }

                Program.GameEngine = null;
            }
            finally
            {
                connectOfflineGameDialog.Dispose();
                connectOfflineGameDialog = null;
            }
        }
Exemplo n.º 2
0
        private void ConnectOfflineGameDialogOnClose(object o, DialogResult dialogResult)
        {
            BorderButtons.IsEnabled = true;
            if (dialogResult == DialogResult.OK)
            {
                if (connectOfflineGameDialog.Successful)
                {
                    if (WindowManager.PreGameLobbyWindow == null)
                    {
                        Program.IsHost     = false;
                        Program.GameEngine = new Octgn.GameEngine(connectOfflineGameDialog.Game, null, true);

                        WindowManager.PreGameLobbyWindow = new PreGameLobbyWindow();
                        WindowManager.PreGameLobbyWindow.Setup(true, WindowManager.Main);
                    }
                }
            }
            connectOfflineGameDialog.Dispose();
            connectOfflineGameDialog = null;
        }