Exemple #1
0
 /// <inheritdoc />
 public override void BeginScreenDeviceChange(bool willBeFullScreen)
 {
     oldClientSize = gameForm.ClientSize;
     if (willBeFullScreen && !isFullScreenMaximized)
     {
         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;
     }
     else
     {
         deviceChangeChangedVisible = false;
     }
     if (!willBeFullScreen && isFullScreenMaximized)
     {
         gameForm.TopMost         = false;
         gameForm.FormBorderStyle = savedFormBorderStyle;
     }
     if (willBeFullScreen != isFullScreenMaximized)
     {
         gameForm.SendToBack();
     }
     deviceChangeWillBeFullScreen = new bool?(willBeFullScreen);
 }