public override void DidFinishLaunching(NSNotification notification) { ApplicationArgs appArgs = GetApplicationArgs(); ExceptionsHandler.SetExceptionHandlers(appArgs.IsTestingMode); ThreadWaiterBuilder.Initialize(new MacApplicationTimerBuilder()); WindowHandler.Initialize(this); GuiMessage.Initialize(new MacOsGuiMessage()); NSApplication.SharedApplication.ActivateIgnoringOtherApps(true); if (appArgs.IsTestingMode) { InstallTestAssembliesResolver(appArgs.PathToAssemblies); } // Tip: you could launch different windows depending on the // argument flags. WindowHandler.LaunchApplicationWindow(); if (appArgs.IsTestingMode) { RemotingHack.ApplyRemotingConfigurationWorkaround(); WindowHandler.LaunchTest(appArgs.TestInfoFile, appArgs.PathToAssemblies); } }
void GuiMessage.IGuiMessage.ShowError(string title, string message) { NSAlert alert = new NSAlert(); alert.MessageText = title; alert.InformativeText = message; alert.Icon = NSImage.ImageNamed(NSImageName.Caution); alert.AlertStyle = NSAlertStyle.Warning; NSButton closeButton = alert.AddButton( Localization.GetText(Localization.Name.Ok)); closeButton.KeyEquivalent = ESC_KEY_EQUIVALENT; WindowHandler.SetActiveDialogForTesting(alert); alert.RunModal(); WindowHandler.RemoveDialogForTesting(alert); }
void Window_WillClose(object sender, EventArgs e) { WindowHandler.UnregisterApplicationWindow(); }