public void Connect(IGPIOReceiver destination, int destinationNumber) { if (destination == null) { throw new ArgumentNullException("destination"); } Validate(destination, destinationNumber); lock (sync) { target = destination; targetNumber = destinationNumber; target.OnGPIO(destinationNumber, state); } }
public void Connect(IGPIOReceiver destination, int destinationNumber) { if(destination == null) { throw new ArgumentNullException("destination"); } Validate(destination, destinationNumber); lock(sync) { target = destination; targetNumber = destinationNumber; target.OnGPIO(destinationNumber, state); } }
public void Connect(IGPIOReceiver destination, int destinationNumber) { if (destination == null) { throw new ArgumentNullException("destination"); } Validate(destination, destinationNumber); lock (sync) { if (!targets.Any(x => x.Receiver == destination && x.Number == destinationNumber)) { targets.Add(new GPIOEndpoint(destination, destinationNumber)); destination.OnGPIO(destinationNumber, state); } } }