Example #1
0
 void InvokeChanges(CLLocation[] locations) => Dispatcher.Execute(async() =>
 {
     var loc     = locations.Last();
     var reading = new GpsReading(loc);
     this.gdelegate.Value?.OnReading(reading);
     this.readingSubject.OnNext(reading);
 });
Example #2
0
        public override void OnReceive(Context context, Intent intent)
        {
            if (!intent.Action.Equals(GpsManagerImpl.IntentAction))
            {
                return;
            }

            var result = LocationResult.ExtractResult(intent);

            if (result == null)
            {
                return;
            }

            this.Execute(async() =>
            {
                var gpsDelegate = ShinyHost.Resolve <IGpsDelegate>();
                foreach (var location in result.Locations)
                {
                    var reading = new GpsReading(location);
                    readingSubject.OnNext(reading);
                    if (gpsDelegate != null)
                    {
                        await gpsDelegate
                        .OnReading(reading)
                        .ConfigureAwait(false);
                    }
                }
            });
        }
Example #3
0
 void InvokeChanges(CLLocation[] locations) => Dispatcher.ExecuteBackgroundTask(async() =>
 {
     var loc     = locations.Last();
     var reading = new GpsReading(loc);
     await this.delegates.Value.RunDelegates(x => x.OnReading(reading));
     this.readingSubject.OnNext(reading);
 });
Example #4
0
        void InvokeChanges(CLLocation[] locations)
        {
            var loc     = locations.Last();
            var reading = new GpsReading(loc);

            this.gdelegate?.OnReading(reading);
            this.readingSubject.OnNext(reading);
        }
Example #5
0
        async void InvokeChanges(CLLocation[] locations)
        {
            var loc     = locations.Last();
            var reading = new GpsReading(loc);

            await this.delegates.Value.RunDelegates(x => x.OnReading(reading));

            this.readingSubject.OnNext(reading);
        }
Example #6
0
        public override void OnReceive(Context context, Intent intent)
        {
            if (!intent.Action.Equals(INTENT_ACTION))
            {
                return;
            }

            var result = LocationResult.ExtractResult(intent);

            if (result == null)
            {
                return;
            }

            var gpsDelegate = ShinyHost.Resolve <IGpsDelegate>();

            foreach (var location in result.Locations)
            {
                var reading = new GpsReading(location);
                readingSubject.OnNext(reading);
                gpsDelegate?.OnReading(reading);
            }
        }