} // end of DisplayFacebookAuthForm() /// <summary> /// The auth form has been closed, restore fullscreen mode if needed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void FormClosedHandler(object sender, System.EventArgs e) { System.Windows.Forms.WebBrowser wb = Facebook.Form.WebBrowser; // TODO (scoy) Get the auth results from the browser before shutting down. string fullText = wb.DocumentText; string[] lines = fullText.Split() if (fullScreen) { BokuGame.Graphics.ToggleFullScreen(); } fullScreen = false; form = null; }
/// <summary> /// Brings up a WinForm with an embedded browser for auth. /// Also puts Kodu into windowed mode if needed. /// </summary> public static void DisplayFacebookAuthForm() { // If we're currently fullscreen we need to remember this // and toggle out to windowed so the auth form will be // displayed over the game. // TODO (scoy) Should we also do this for picking a printer // when we're fullscreen? fullScreen = BokuGame.Graphics.IsFullScreen; if (fullScreen) { BokuGame.Graphics.ToggleFullScreen(); } form = new BrowserForm(); form.Show(); form.BringToFront(); form.Closed += FormClosedHandler; } // end of DisplayFacebookAuthForm()