Inheritance: MonoMac.AppKit.NSApplicationDelegate
Esempio n. 1
0
		public override void InitializeApplication ()
		{
			NSApplication.Init ();
			//Hijack ();
			if (pool != null)
				pool.Dispose ();
			pool = new NSAutoreleasePool ();
			appDelegate = new AppDelegate (IsGuest);
			NSApplication.SharedApplication.Delegate = appDelegate;

			// If NSPrincipalClass is not set, set it now. This allows running
			// the application without a bundle
			var info = NSBundle.MainBundle.InfoDictionary;
			if (info.ValueForKey ((NSString)"NSPrincipalClass") == null)
				info.SetValueForKey ((NSString)"NSApplication", (NSString)"NSPrincipalClass");
		}
Esempio n. 2
0
		public override void InitializeApplication ()
		{
			if(!IsGuest) {
				NSApplicationInitializer.Initialize();
			}

			//Hijack ();
			if (pool != null)
				pool.Dispose ();
			pool = new NSAutoreleasePool ();
			appDelegate = new AppDelegate (IsGuest);
			NSApplication.SharedApplication.Delegate = appDelegate;

			// If NSPrincipalClass is not set, set it now. This allows running
			// the application without a bundle
			var info = NSBundle.MainBundle.InfoDictionary;
			if (info.ValueForKey ((NSString)"NSPrincipalClass") == null)
				info.SetValueForKey ((NSString)"NSApplication", (NSString)"NSPrincipalClass");

			//Application listeners
			NSNotificationCenter.DefaultCenter.AddObserver(NSApplication.DidResignActiveNotification, OnDeactivated);
			NSNotificationCenter.DefaultCenter.AddObserver(NSApplication.DidBecomeActiveNotification, OnActivated);
		}
Esempio n. 3
0
 public override void InitializeApplication()
 {
     NSApplication.Init ();
     //Hijack ();
     if (pool != null)
         pool.Dispose ();
     pool = new NSAutoreleasePool ();
     appDelegate = new AppDelegate (IsGuest);
     NSApplication.SharedApplication.Delegate = appDelegate;
 }