示例#1
0
        public LocationService(LocationConfig config)
        {
            _Config = config;
            State   = LocationServiceState.None;

            _Manager = (LocationManager)config.AppContext.GetSystemService(Context.LocationService);
        }
示例#2
0
 public void Configure(IMvxPluginConfiguration configuration)
 {
     if (!(configuration is LocationConfig))
     {
         throw new ArgumentException("Configuration is not a LocationConfig");
     }
     _Config = (LocationConfig)configuration;
 }
示例#3
0
 public LocationPlayService(LocationConfig config)
 {
     _Config = config;
     //  check if play services is enabled
     if (_Config.CheckEnabled == null)
     {
         throw new Exception("Unable to check whether play services are available. Make sure you have a CheckEnabled Action.");
     }
     State   = (_Config.CheckEnabled()) ? LocationServiceState.Enabled : LocationServiceState.Disabled;
     _Client = LocationServices.GetFusedLocationProviderClient(config.AppContext);
     if (_Client == null)
     {
         State = LocationServiceState.Disabled;
     }
 }