Example #1
0
 protected override void UpdateUIState(Action action)
 {
     if (m_app != null)
     {
         m_app.BeginInvokeOnMainThread(() => {
             action();
         });
     }
     else
     {
         action();
     }
 }
        internal static void ShowSigninSheet()
        {
            NSApplication    NSApp      = NSApplication.SharedApplication;
            NSWindow         gameWindow = NSApp.MainWindow;
            SigninController controller = new SigninController();

            NSWindow window = controller.Window;

            NSApp.BeginInvokeOnMainThread(delegate {
                Guide.isVisible = true;
                NSApp.BeginSheet(window, gameWindow);
                NSApp.RunModalForWindow(window);
                // sheet is up here.....

                NSApp.EndSheet(window);
                window.OrderOut(gameWindow);
                Guide.isVisible = false;
            });
        }
        internal static void ShowSigninSheet()
        {
            NSApplication NSApp      = NSApplication.SharedApplication;
            NSWindow      gameWindow = NSApp.MainWindow;

            SigninController controller = new SigninController();

            NSWindow window = controller.Window;

            // Something has happened with BeginSheet and needs to be looked into.
            // Until then just use modal for now.
            var frame    = window.Frame;
            var location = new PointF(gameWindow.Frame.Bottom, gameWindow.Frame.Left);

            location = new PointF(gameWindow.Frame.Location.X, gameWindow.Frame.Location.Y);

            window.SetFrameOrigin(location);
            NSApp.BeginInvokeOnMainThread(delegate {
                Guide.isVisible = true;
//				NSApp.BeginSheet (window, gameWindow);
                NSApp.RunModalForWindow(window);
//				// sheet is up here.....
//
//				NSApp.EndSheet (window);
                window.OrderOut(gameWindow);
                Guide.isVisible = false;
//
            });
            //window.MakeKeyAndOrderFront(gameWindow);
//				SignedInGamer sig = new SignedInGamer();
//				sig.DisplayName = "MonoMac Gamer";
//				sig.Gamertag = "MonoMac Gamer";
//				sig.InternalIdentifier = Guid.NewGuid();
//
//				Gamer.SignedInGamers.Add(sig);
        }