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 ShowJoinOfflineGameDialog() { connectOfflineGameDialog = new ConnectOfflineGame(); connectOfflineGameDialog.Show(DialogPlaceHolder); connectOfflineGameDialog.OnClose += ConnectOfflineGameDialogOnClose; BorderButtons.IsEnabled = false; }
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; }
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,connectOfflineGameDialog.Password, true); WindowManager.PreGameLobbyWindow = new PreGameLobbyWindow(); WindowManager.PreGameLobbyWindow.Setup(true, WindowManager.Main); } } } connectOfflineGameDialog.Dispose(); connectOfflineGameDialog = null; }
private void ConnectOfflineGameDialogOnClose(object o, DialogResult dialogResult) { BorderButtons.IsEnabled = true; try { if (dialogResult == DialogResult.OK) { if (connectOfflineGameDialog.Successful) { if (WindowManager.PreGameLobbyWindow == null) { WindowManager.PreGameLobbyWindow = new PreGameLobbyWindow(); WindowManager.PreGameLobbyWindow.Setup(true, WindowManager.Main); return; } } } try { Program.GameEngine.End(); } catch{} Program.GameEngine = null; } finally { connectOfflineGameDialog.Dispose(); connectOfflineGameDialog = null; } }