コード例 #1
0
 public IObservable <int> WhenReadingTaken()
 => this.stepOb ??= Observable.Create <int>(ob =>
 {
     var scm = new CMStepCounter();
     scm.StartStepCountingUpdates(NSOperationQueue.CurrentQueue ?? new NSOperationQueue(), 1, (steps, timestamp, error) =>
                                  ob.OnNext((int)steps)
                                  );
     return(() =>
     {
         scm.StopStepCountingUpdates();
         scm.Dispose();
     });
 })
 .Publish()
 .RefCount();
コード例 #2
0
 public IObservable <int> WhenReadingTaken()
 {
     this.stepOb = this.stepOb ?? Observable.Create <int>(ob =>
     {
         var scm = new CMStepCounter();
         scm.StartStepCountingUpdates(NSOperationQueue.CurrentQueue, 10, (steps, timestamp, error) =>
         {
         });
         return(() =>
         {
             scm.StopStepCountingUpdates();
             scm.Dispose();
         });
     });
     return(this.stepOb);
 }
コード例 #3
0
 public void Dispose()
 {
     motionManger.Dispose();
     stepCounter.Dispose();
 }