Пример #1
0
        /// <inheritdoc />
        public override void BeginScreenDeviceChange(bool willBeFullScreen)
        {
            if (gameForm != null)
            {
                oldClientSize = gameForm.ClientSize;
            }
            if (willBeFullScreen && !isFullScreenMaximized && gameForm != null)
            {
                savedFormBorderStyle = gameForm.FormBorderStyle;
                savedWindowState     = gameForm.WindowState;
                savedBounds          = gameForm.Bounds;
                if (gameForm.WindowState == FormWindowState.Maximized)
                {
                    savedRestoreBounds = gameForm.RestoreBounds;
                }
            }

            if (willBeFullScreen != isFullScreenMaximized)
            {
                deviceChangeChangedVisible = true;
                oldVisible = Visible;
                Visible    = false;

                if (gameForm != null)
                {
                    gameForm.SendToBack();
                }
            }
            else
            {
                deviceChangeChangedVisible = false;
            }

            if (!willBeFullScreen && isFullScreenMaximized && gameForm != null)
            {
                gameForm.TopMost         = false;
                gameForm.FormBorderStyle = savedFormBorderStyle;
            }

            deviceChangeWillBeFullScreen = willBeFullScreen;
        }
Пример #2
0
        /// <inheritdoc />
        public override void BeginScreenDeviceChange(bool willBeFullScreen)
        {
            if (gameForm != null)
                oldClientSize = gameForm.ClientSize;
            if (willBeFullScreen && !isFullScreenMaximized && gameForm != null)
            {
                savedFormBorderStyle = gameForm.FormBorderStyle;
                savedWindowState = gameForm.WindowState;
                savedBounds = gameForm.Bounds;
                if (gameForm.WindowState == FormWindowState.Maximized)
                    savedRestoreBounds = gameForm.RestoreBounds;
            }

            if (willBeFullScreen != isFullScreenMaximized)
            {
                deviceChangeChangedVisible = true;
                oldVisible = Visible;
                Visible = false;

                if (gameForm != null)
                    gameForm.SendToBack();
            }
            else
            {
                deviceChangeChangedVisible = false;
            }

            if (!willBeFullScreen && isFullScreenMaximized && gameForm != null)
            {
                gameForm.TopMost = false;
                gameForm.FormBorderStyle = savedFormBorderStyle;
            }

            deviceChangeWillBeFullScreen = willBeFullScreen;
        }