Inheritance: System.Windows.Controls.UserControl
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 ShowJoinOfflineGameDialog()
 {
     connectOfflineGameDialog = new ConnectOfflineGame();
     connectOfflineGameDialog.Show(DialogPlaceHolder);
     connectOfflineGameDialog.OnClose += ConnectOfflineGameDialogOnClose;
     BorderButtons.IsEnabled           = false;
 }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
0
 private void ShowJoinOfflineGameDialog()
 {
     connectOfflineGameDialog = new ConnectOfflineGame();
     connectOfflineGameDialog.Show(DialogPlaceHolder);
     connectOfflineGameDialog.OnClose += ConnectOfflineGameDialogOnClose;
     BorderButtons.IsEnabled = false;
 }
Exemplo n.º 5
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,connectOfflineGameDialog.Password, true);

                        WindowManager.PreGameLobbyWindow = new PreGameLobbyWindow();
                        WindowManager.PreGameLobbyWindow.Setup(true, WindowManager.Main);
                    }
                }
            }
            connectOfflineGameDialog.Dispose();
            connectOfflineGameDialog = null;
        }
Exemplo n.º 6
0
        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;
            }
        }