/// <summary> /// Gets the native driver based on camera model. /// </summary> /// <param name="model">The model name.</param> /// <returns>If the model not supported return null else the driver type</returns> private Type GetNativeDriver(string model) { if (String.IsNullOrEmpty(model)) { return(null); } // first check if driver exist with same driver name if (DeviceClass.ContainsKey(model)) { return(DeviceClass[model]); } // in driver not found will check with regex name return((from keyValuePair in DeviceClass let regex = new Regex(keyValuePair.Key) where regex.IsMatch(model) select keyValuePair.Value).FirstOrDefault()); }