/// <summary>
        /// Construct a new provider handler class.
        /// </summary>
        public MTVProviderHandler()
        {
            // The comparer.
            this.pComparer = new HidContactInfoEqualityComparer();

            // Create the contact list and tables.
            this.lCurrentContacts = new Queue <HidContactInfo>();
            this.dLastContacts    = new Dictionary <int, HidContactInfo>();
            this.pContactLock     = new Mutex();
        }
Example #2
0
        /// <summary>
        /// Construct a new provider handler class.
        /// </summary>
        public ProviderHandler()
        {
            // The comparer.
            this.pComparer = new HidContactInfoEqualityComparer();

            // Create the contact list and tables.
            this.lCurrentContacts = new Queue <HidContactInfo>();
            this.dLastContacts    = new Dictionary <int, HidContactInfo>();
            this.pContactLock     = new Mutex();

            // Access the HID device driver.
            this.pDevice = HidDevices.Enumerate(0xdddd, 0x0001).FirstOrDefault();
            if (this.pDevice == null)
            {
                throw new InvalidOperationException("Universal Software HID driver was not found. Please ensure that it is installed.");
            }
            this.pDevice.Open(HidDevice.DeviceMode.Overlapped, HidDevice.DeviceMode.NonOverlapped);
        }