Beispiel #1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (MessageBoxCommon.Show("Do you want to exit a game?", MessageBoxType.YesNo) == MessageBoxReply.No)
            {
                e.Cancel = true;
                return;
            }

            _GameView.CloseView();

            Main._GameRoom  = null;
            Main.activeGame = null;
            Main.u_gamrId   = null;
            Window1._ClientEngine.Send(NotifyType.Request_OutGame, Window1._UserInfo);
            Window1._ClientEngine.DetachHandler(_GameView.NotifyOccured);
        }
Beispiel #2
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_AutoClose == false)
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                if (QQMessageBox.Show(tempWindowForm, "您想离开游戏吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
            }


            // 2014-04-01: GreenRose
            // 게임방에서 나간상태를 알린다.
            Login._UserInfo.nUserState = 13;
            Login._ClientEngine.Send(NotifyType.Request_UserState, Login._UserInfo);

            _GameView.CloseView();

            Main._GameRoom  = null;
            Main.activeGame = null;
            Main.u_gamrId   = null;

            Login._ClientEngine.Send(NotifyType.Request_OutGame, Login._UserInfo);
            Login._ClientEngine.DetachHandler(_GameView.NotifyOccured);

            Login._ClientEngine.DetachHandler(NotifyOccured);
            Login._ClientEngine.DetachHandler(OnReceive);

            _GameView.SetFrameWindowProc(null);
            _GameView.Dispose();
            _GameView = null;

            host.Child = null;
        }