Cocoa.Bundle.Load C# (CSharp) Method

Load() public method

public Load ( ) : void
return void
        public void Load()
        {
            ObjCMessaging.objc_msgSend (NativeObject, "load", typeof (void));
        }

Usage Example

Esempio n. 1
0
 public static void LoadFramework(string frameworkname)
 {
     if (Directory.Exists(System.String.Format("/System/Library/Frameworks/{0}.framework", frameworkname)))
     {
         Bundle b = Bundle.BundleWithPath(System.String.Format("/System/Library/Frameworks/{0}.framework", frameworkname));
         if (b.NativeObject == IntPtr.Zero)
         {
             throw new Exception("Error loading framework: {0}" + frameworkname);
         }
         b.Load();
         return;
     }
     if (Directory.Exists(System.String.Format("./{0}.framework", frameworkname)))
     {
         Bundle b = Bundle.BundleWithPath(System.String.Format("./{0}.framework", frameworkname));
         if (b.NativeObject == IntPtr.Zero)
         {
             throw new Exception("Error loading framework: {0}" + frameworkname);
         }
         b.Load();
         return;
     }
     // TODO: Load from MainBundle.ResourcePath
     throw new Exception("Couldn't locate framework: " + frameworkname);
 }