Пример #1
0
        // Add Maps capability to the project.
        public void AddMaps(MapsOptions options)
        {
            var bundleArr = (GetOrCreateInfoDoc().root[MapsInfo.BundleKey] ?? (GetOrCreateInfoDoc().root[MapsInfo.BundleKey] = new PlistElementArray())) as PlistElementArray;

            bundleArr.values.Add(new PlistElementDict());
            PlistElementDict bundleDic = GetOrCreateUniqueDictElementInArray(bundleArr);

            bundleDic[MapsInfo.BundleNameKey] = new PlistElementString(MapsInfo.BundleNameValue);
            var bundleTypeArr = (bundleDic[MapsInfo.BundleTypeKey] ?? (bundleDic[MapsInfo.BundleTypeKey] = new PlistElementArray())) as PlistElementArray;

            GetOrCreateStringElementInArray(bundleTypeArr, MapsInfo.BundleTypeValue);

            var optionArr = (GetOrCreateInfoDoc().root[MapsInfo.ModeKey] ??
                             (GetOrCreateInfoDoc().root[MapsInfo.ModeKey] = new PlistElementArray())) as PlistElementArray;

            if ((options & MapsOptions.Airplane) == MapsOptions.Airplane)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModePlaneValue);
            }
            if ((options & MapsOptions.Bike) == MapsOptions.Bike)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeBikeValue);
            }
            if ((options & MapsOptions.Bus) == MapsOptions.Bus)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeBusValue);
            }
            if ((options & MapsOptions.Car) == MapsOptions.Car)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeCarValue);
            }
            if ((options & MapsOptions.Ferry) == MapsOptions.Ferry)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeFerryValue);
            }
            if ((options & MapsOptions.Other) == MapsOptions.Other)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeOtherValue);
            }
            if ((options & MapsOptions.Pedestrian) == MapsOptions.Pedestrian)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModePedestrianValue);
            }
            if ((options & MapsOptions.RideSharing) == MapsOptions.RideSharing)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeRideShareValue);
            }
            if ((options & MapsOptions.StreetCar) == MapsOptions.StreetCar)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeStreetCarValue);
            }
            if ((options & MapsOptions.Subway) == MapsOptions.Subway)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeSubwayValue);
            }
            if ((options & MapsOptions.Taxi) == MapsOptions.Taxi)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeTaxiValue);
            }
            if ((options & MapsOptions.Train) == MapsOptions.Train)
            {
                GetOrCreateStringElementInArray(optionArr, MapsInfo.ModeTrainValue);
            }

            project.AddCapability(m_TargetGuid, PBXCapabilityType.Maps);
        }
        static void AddCapabilities(PBXProject proj, string targetGuid, ProjectCapabilityManager capManager)
        {
            var capability = ISD_Settings.Instance.Capability;

            if (capability.iCloud.Enabled)
            {
                if (capability.iCloud.iCloudDocument || capability.iCloud.customContainers.Count > 0)
                {
                    capManager.AddiCloud(capability.iCloud.keyValueStorage, capability.iCloud.iCloudDocument, capability.iCloud.customContainers.ToArray());
                }
                else
                {
                    capManager.AddiCloud(capability.iCloud.keyValueStorage, false, null);
                }
            }

            if (capability.PushNotifications.Enabled)
            {
                capManager.AddPushNotifications(capability.PushNotifications.development);
            }

            if (capability.GameCenter.Enabled)
            {
                capManager.AddGameCenter();
            }

            if (capability.Wallet.Enabled)
            {
                capManager.AddWallet(capability.Wallet.passSubset.ToArray());
            }

            if (capability.Siri.Enabled)
            {
                capManager.AddSiri();
            }

            if (capability.ApplePay.Enabled)
            {
                capManager.AddApplePay(capability.ApplePay.merchants.ToArray());
            }

            if (capability.InAppPurchase.Enabled)
            {
                capManager.AddInAppPurchase();
            }

            if (capability.Maps.Enabled)
            {
                var options = MapsOptions.None;
                foreach (var opt in capability.Maps.options)
                {
                    MapsOptions opt2 = (MapsOptions)opt;
                    options |= opt2;
                }
                capManager.AddMaps(options);
            }

            if (capability.PersonalVPN.Enabled)
            {
                capManager.AddPersonalVPN();
            }

            if (capability.BackgroundModes.Enabled)
            {
                var options = BackgroundModesOptions.None;
                foreach (var opt in capability.BackgroundModes.options)
                {
                    BackgroundModesOptions opt2 = (BackgroundModesOptions)opt;
                    options |= opt2;
                }
                capManager.AddBackgroundModes(options);
            }


            if (capability.InterAppAudio.Enabled)
            {
                capManager.AddInterAppAudio();
            }

            if (capability.KeychainSharing.Enabled)
            {
                capManager.AddKeychainSharing(capability.KeychainSharing.accessGroups.ToArray());
            }

            if (capability.AssociatedDomains.Enabled)
            {
                capManager.AddAssociatedDomains(capability.AssociatedDomains.domains.ToArray());
            }

            if (capability.AppGroups.Enabled)
            {
                capManager.AddAppGroups(capability.AppGroups.groups.ToArray());
            }

            if (capability.DataProtection.Enabled)
            {
                capManager.AddDataProtection();
            }

            if (capability.HomeKit.Enabled)
            {
                capManager.AddHomeKit();
            }

            if (capability.HealthKit.Enabled)
            {
                capManager.AddHealthKit();
            }

            if (capability.WirelessAccessoryConfiguration.Enabled)
            {
                capManager.AddWirelessAccessoryConfiguration();
            }

            /*
             *
             *
             * if (ISD_Settings.Instance.Capabilities.Count == 0) {
             *  return;
             * }
             *
             *
             * foreach (var cap in ISD_Settings.Instance.Capabilities) {
             *  switch(cap.CapabilityType) {
             *
             *
             *       case ISD_CapabilityType.InAppPurchase:
             *          capManager.AddInAppPurchase();
             *          break;
             *      case ISD_CapabilityType.GameCenter:
             *          capManager.AddGameCenter();
             *          break;
             *      case ISD_CapabilityType.PushNotifications:
             *          var pushSettings = ISD_Settings.Instance.PushNotificationsCapabilitySettings;
             *          capManager.AddPushNotifications(pushSettings.Development);
             *          break;
             *
             *      default:
             *          var capability = ISD_PBXCapabilityTypeUtility.ToPBXCapability(cap.CapabilityType);
             *          string entitlementsFilePath = null;
             *          if(!string.IsNullOrEmpty(cap.EntitlementsFilePath)) {
             *              entitlementsFilePath = cap.EntitlementsFilePath;
             *          }
             *
             *
             *          proj.AddCapability(targetGuid, capability, entitlementsFilePath, cap.AddOptionalFramework);
             *          break;
             *  }
             * }
             */
        }
Пример #3
0
        public void AddMaps(MapsOptions options)
        {
            PlistElementArray root1 = (this.GetOrCreateInfoDoc().root[MapsInfo.BundleKey] ?? (this.GetOrCreateInfoDoc().root[MapsInfo.BundleKey] = (PlistElement) new PlistElementArray())) as PlistElementArray;

            root1.values.Add((PlistElement) new PlistElementDict());
            PlistElementDict dictElementInArray = this.GetOrCreateUniqueDictElementInArray(root1);

            dictElementInArray[MapsInfo.BundleNameKey] = (PlistElement) new PlistElementString(MapsInfo.BundleNameValue);
            this.GetOrCreateStringElementInArray((dictElementInArray[MapsInfo.BundleTypeKey] ?? (dictElementInArray[MapsInfo.BundleTypeKey] = (PlistElement) new PlistElementArray())) as PlistElementArray, MapsInfo.BundleTypeValue);
            PlistElementArray root2 = (this.GetOrCreateInfoDoc().root[MapsInfo.ModeKey] ?? (this.GetOrCreateInfoDoc().root[MapsInfo.ModeKey] = (PlistElement) new PlistElementArray())) as PlistElementArray;

            if ((options & MapsOptions.Airplane) == MapsOptions.Airplane)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModePlaneValue);
            }
            if ((options & MapsOptions.Bike) == MapsOptions.Bike)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeBikeValue);
            }
            if ((options & MapsOptions.Bus) == MapsOptions.Bus)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeBusValue);
            }
            if ((options & MapsOptions.Car) == MapsOptions.Car)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeCarValue);
            }
            if ((options & MapsOptions.Ferry) == MapsOptions.Ferry)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeFerryValue);
            }
            if ((options & MapsOptions.Other) == MapsOptions.Other)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeOtherValue);
            }
            if ((options & MapsOptions.Pedestrian) == MapsOptions.Pedestrian)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModePedestrianValue);
            }
            if ((options & MapsOptions.RideSharing) == MapsOptions.RideSharing)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeRideShareValue);
            }
            if ((options & MapsOptions.StreetCar) == MapsOptions.StreetCar)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeStreetCarValue);
            }
            if ((options & MapsOptions.Subway) == MapsOptions.Subway)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeSubwayValue);
            }
            if ((options & MapsOptions.Taxi) == MapsOptions.Taxi)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeTaxiValue);
            }
            if ((options & MapsOptions.Train) == MapsOptions.Train)
            {
                this.GetOrCreateStringElementInArray(root2, MapsInfo.ModeTrainValue);
            }
            this.project.AddCapability(this.m_TargetGuid, PBXCapabilityType.Maps, (string)null, false);
        }
Пример #4
0
        private static void AddCapabilities(ProjectCapabilityManager capManager)
        {
            var capability = ISD_Settings.Instance.Capability;

            if (capability.iCloud.Enabled)
            {
                if (capability.iCloud.iCloudDocument || capability.iCloud.customContainers.Count > 0)
                {
                    capManager.AddiCloud(capability.iCloud.keyValueStorage, capability.iCloud.iCloudDocument, capability.iCloud.customContainers.ToArray());
                }
                else
                {
                    capManager.AddiCloud(capability.iCloud.keyValueStorage, false, null);
                }
            }

            if (capability.PushNotifications.Enabled)
            {
                capManager.AddPushNotifications(capability.PushNotifications.development);
            }

            if (capability.GameCenter.Enabled)
            {
                capManager.AddGameCenter();
            }

            if (capability.Wallet.Enabled)
            {
                capManager.AddWallet(capability.Wallet.passSubset.ToArray());
            }

            if (capability.Siri.Enabled)
            {
                capManager.AddSiri();
            }

            if (capability.ApplePay.Enabled)
            {
                capManager.AddApplePay(capability.ApplePay.merchants.ToArray());
            }

            if (capability.InAppPurchase.Enabled)
            {
                capManager.AddInAppPurchase();
            }

            if (capability.Maps.Enabled)
            {
                var options = MapsOptions.None;
                foreach (var opt in capability.Maps.options)
                {
                    MapsOptions opt2 = (MapsOptions)opt;
                    options |= opt2;
                }
                capManager.AddMaps(options);
            }

            if (capability.PersonalVPN.Enabled)
            {
                capManager.AddPersonalVPN();
            }

            if (capability.BackgroundModes.Enabled)
            {
                var options = BackgroundModesOptions.None;
                foreach (var opt in capability.BackgroundModes.options)
                {
                    BackgroundModesOptions opt2 = (BackgroundModesOptions)opt;
                    options |= opt2;
                }
                capManager.AddBackgroundModes(options);
            }


            if (capability.InterAppAudio.Enabled)
            {
                capManager.AddInterAppAudio();
            }

            if (capability.KeychainSharing.Enabled)
            {
                capManager.AddKeychainSharing(capability.KeychainSharing.accessGroups.ToArray());
            }

            if (capability.AssociatedDomains.Enabled)
            {
                capManager.AddAssociatedDomains(capability.AssociatedDomains.domains.ToArray());
            }

            if (capability.AppGroups.Enabled)
            {
                capManager.AddAppGroups(capability.AppGroups.groups.ToArray());
            }

            if (capability.DataProtection.Enabled)
            {
                capManager.AddDataProtection();
            }

            if (capability.HomeKit.Enabled)
            {
                capManager.AddHomeKit();
            }

            if (capability.HealthKit.Enabled)
            {
                capManager.AddHealthKit();
            }

            if (capability.WirelessAccessoryConfiguration.Enabled)
            {
                capManager.AddWirelessAccessoryConfiguration();
            }
        }