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; } }
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; }