partial void Stop() { this.Try(() => { var manager = (SensorManager)Application.Context.GetSystemService(Context.SensorService); manager.UnregisterListener(this.listener); this.listener = null; }); }
partial void Start() { this.Try(() => { this.listener = new GyroscopeListener(e => this.readingAvailable.Invoke <GyroReading>( this, new GyroReading(e.Values[0], e.Values[1], e.Values[2]))); var manager = (SensorManager)Application.Context.GetSystemService(Context.SensorService); manager.RegisterListener(this.listener, manager.GetDefaultSensor(SensorType.Gyroscope), this.rate); }); }
partial void Start() { this.Try(() => { this.listener = new GyroscopeListener(e => this.readingAvailable.Invoke<GyroReading>( this, new GyroReading(e.Values[0], e.Values[1], e.Values[2]))); var manager = (SensorManager)Application.Context.GetSystemService(Context.SensorService); manager.RegisterListener(this.listener, manager.GetDefaultSensor(SensorType.Gyroscope), this.rate); }); }