Пример #1
0
 public SensorSubscription(SensorObservable observable, ISensorObserver observer)
 {
     if (observable == null)
     {
         throw new ArgumentNullException("observable");
     }
     if (observer == null)
     {
         throw new ArgumentNullException("observer");
     }
     this.observable = observable;
     this.observer   = observer;
 }
Пример #2
0
 public CaptureSystem()
 {
     invokeSync     = new object();
     sensorSync     = new object();
     observableSync = new object();
     thread         = null;
     threadCancel   = null;
     toInvoke       = new Queue <EventHandler>();
     invokeSignal   = new AutoResetEvent(false);
     sensors        = new ISensorBase[MaxSensorNo];
     subscriptions  = new IDisposable[MaxSensorNo];
     observables    = new SensorObservable[MaxSensorNo];
     for (int i = 0; i < observables.Length; i++)
     {
         observables[i] = new SensorObservable();
     }
 }