/// <summary> /// Initializes a new instance of the <see cref="Hub" /> class. /// </summary> /// <param name="deviceListener">The device listener.</param> /// <exception cref="System.ArgumentNullException">Thrown when the device listener is null.</exception> protected Hub(IDeviceListener deviceListener) { _myos = new Dictionary <IntPtr, IMyo>(); _readonlyMyos = new ReadOnlyMyoCollection(_myos); _deviceListener = deviceListener; _deviceListener.Paired += DeviceListener_Paired; _deviceListener.Unpaired += DeviceListener_Unpaired; }
/// <summary> /// Initializes a new instance of the <see cref="Hub" /> class. /// </summary> /// <param name="deviceListener">The device listener.</param> /// <exception cref="System.ArgumentNullException">Thrown when the device listener is null.</exception> protected Hub(IDeviceListener deviceListener) { Contract.Requires <ArgumentNullException>(deviceListener != null, "deviceListener"); _myos = new Dictionary <IntPtr, IMyo>(); _readonlyMyos = new ReadOnlyMyoCollection(_myos); _deviceListener = deviceListener; _deviceListener.Paired += DeviceListener_Paired; _deviceListener.Unpaired += DeviceListener_Unpaired; }
/// <summary> /// Initializes a new instance of the <see cref="Hub" /> class. /// </summary> /// <param name="deviceListener">The device listener.</param> /// <exception cref="System.ArgumentNullException">Thrown when the device listener is null.</exception> protected Hub(IDeviceListener deviceListener) { Contract.Requires<ArgumentNullException>(deviceListener != null, "deviceListener"); _myos = new Dictionary<IntPtr, IMyo>(); _readonlyMyos = new ReadOnlyMyoCollection(_myos); _deviceListener = deviceListener; _deviceListener.Paired += DeviceListener_Paired; _deviceListener.Unpaired += DeviceListener_Unpaired; }
/// <summary> /// Initializes a new instance of the <see cref="Hub" /> class. /// </summary> /// <param name="deviceListener">The device listener.</param> /// <exception cref="System.ArgumentNullException">Thrown when the device listener is null.</exception> protected Hub(IDeviceListener deviceListener) { if (deviceListener == null) { throw new ArgumentNullException("deviceListener", "The device listener cannot be null."); } _myos = new Dictionary <IntPtr, IMyo>(); _readonlyMyos = new ReadOnlyMyoCollection(_myos); _deviceListener = deviceListener; _deviceListener.Paired += DeviceListener_Paired; }