Ejemplo n.º 1
0
 /// <inheritdoc />
 /// <summary>
 /// Enables or disables Bind Mode
 /// </summary>
 /// <param name="mode"></param>
 public void SetDetectionMode(DetectionMode mode)
 {
     DetectionMode = mode;
     if (mode == DetectionMode.Bind)
     {
         _processUpdates = ProcessBindModeUpdates;
     }
     else
     {
         _processUpdates = ProcessSubscriptionModeUpdates;
     }
     // If switching from Bind Mode back to Subscription mode and there are no Bindings, fire the empty handler (eg to kill the PollThread)
     if (mode == DetectionMode.Subscription && SubHandler.Count() == 0)
     {
         OnDeviceEmpty(this, DeviceDescriptor);
     }
 }