public MapsCapability(MapsCapability other)
     : base(other)
 {
     Airplane    = other.Airplane;
     Bike        = other.Bike;
     Bus         = other.Bus;
     Car         = other.Car;
     Ferry       = other.Ferry;
     Pedestrian  = other.Pedestrian;
     RideSharing = other.RideSharing;
     Streetcar   = other.Streetcar;
     Subway      = other.Subway;
     Taxi        = other.Taxi;
     Train       = other.Train;
     Other       = other.Other;
 }
Exemple #2
0
        //Maps
        void ApplyMapsCapability(MapsCapability capability)
        {
            //update pbxproject
            _pbxproj.EnableSystemCapability("com.apple.Maps.iOS", true);
            _pbxproj.AddSystemFramework("MapKit.framework", LinkType.Required);
            //update info.plist
            var changes = new PListDictionary();
            var modes   = new PListArray();

            if (capability.Airplane)
            {
                modes.Add("MKDirectionsModePlane");
            }

            if (capability.Bike)
            {
                modes.Add("MKDirectionsModeBike");
            }

            if (capability.Bus)
            {
                modes.Add("MKDirectionsModeBus");
            }

            if (capability.Car)
            {
                modes.Add("MKDirectionsModeCar");
            }

            if (capability.Ferry)
            {
                modes.Add("MKDirectionsModeFerry");
            }

            if (capability.Other)
            {
                modes.Add("MKDirectionsModeOther");
            }

            if (capability.Pedestrian)
            {
                modes.Add("MKDirectionsModePedestrian");
            }

            if (capability.RideSharing)
            {
                modes.Add("MKDirectionsModeRideShare");
            }

            if (capability.Streetcar)
            {
                modes.Add("MKDirectionsModeStreetCar");
            }

            if (capability.Subway)
            {
                modes.Add("MKDirectionsModeSubway");
            }

            if (capability.Taxi)
            {
                modes.Add("MKDirectionsModeTaxi");
            }

            if (capability.Train)
            {
                modes.Add("MKDirectionsModeTrain");
            }

            if (modes.Count > 0)
            {
                changes.Add("MKDirectionsApplicationSupportedModes", modes);
                var docType = new PListDictionary();
                docType.Add("CFBundleTypeName", "MKDirectionsRequest");
                docType.Add("LSItemContentTypes", new PListArray("com.apple.maps.directionsrequest"));
                var docTypes = new PListArray(docType);
                changes.Add("CFBundleDocumentTypes", docTypes);
                ApplyInfoPlistChanges(changes);
            }
        }