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); });
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); } } }); }
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); });
void InvokeChanges(CLLocation[] locations) { var loc = locations.Last(); var reading = new GpsReading(loc); this.gdelegate?.OnReading(reading); this.readingSubject.OnNext(reading); }
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); }
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); } }