示例#1
0
 public static CFBundle[] GetBundlesFromDirectory(NSUrl directoryUrl, string bundleType)
 {
     if (directoryUrl == null) // NSUrl cannot be "" by definition
         throw new ArgumentNullException ("directoryUrl");
     if (String.IsNullOrEmpty (bundleType))
         throw new ArgumentException ("bundleType");
     using (var bundleTypeCFSting = new CFString (bundleType))
     using (var cfBundles = new CFArray (CFBundleCreateBundlesFromDirectory (IntPtr.Zero, directoryUrl.Handle, bundleTypeCFSting.Handle), true)) {
         var managedBundles = new CFBundle [cfBundles.Count];
         for (int index = 0; index < cfBundles.Count; index++) {
             // follow the create rules, therefore we do have ownership of each of the cfbundles
             managedBundles [index] = new CFBundle (cfBundles.GetValue (index), true);
         }
         return managedBundles;
     }
 }
示例#2
0
 public PackageInfo(CFBundle.PackageType type, string creator)
 {
     this.Type = type;
     this.Creator = creator;
 }
示例#3
0
 public static CFBundle[] GetAll()
 {
     using (var cfBundles = new CFArray (CFBundleGetAllBundles ())) {
         var managedBundles = new CFBundle [cfBundles.Count];
         for (int index = 0; index < cfBundles.Count; index++) {
             // follow the get rule, we do not own the object
             managedBundles [index] = new CFBundle (cfBundles.GetValue (index), false);
         }
         return managedBundles;
     }
 }