Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }
Ejemplo n.º 3
0
        /// <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;
        }
Ejemplo n.º 4
0
        /// <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;
        }