예제 #1
0
        public bool Equals(NwdDeviceKey key)
        {
            // If parameter is null return false:
            if ((object)key == null)
            {
                return false;
            }

            // Return true if the fields match:
            return (key.Description.Equals(Description));
        }
예제 #2
0
        /// <summary>
        /// returns device database id if found, -1 if not found
        /// </summary>
        /// <param name="description"></param>
        /// <param name="friendlyName"></param>
        /// <param name="model"></param>
        /// <param name="deviceType"></param>
        /// <returns></returns>
        public int GetDeviceId(string description,
                               string friendlyName,
                               string model,
                               string deviceType)
        {
            RefreshDeviceIds();

            NwdDeviceKey deviceKey =
                new NwdDeviceKey(description
                //,
                //                 friendlyName,
                //                 model,
                //                 deviceType
                                 );

            if (deviceIds.ContainsKey(deviceKey))
            {
                return deviceIds[deviceKey];
            }

            return -1;
        }