}
}
+ public bool FromIndex(int index, out T device)
+ {
+ if (index >= 0 && index < Devices.Count)
+ {
+ device = Devices[index];
+ return true;
+ }
+ else
+ {
+ device = default(T);
+ return false;
+ }
+ }
+
public T FromHardwareId(long id)
{
if (Map.ContainsKey(id))
}
}
+ public bool FromHardwareId(long id, out T device)
+ {
+ if (Map.ContainsKey(id))
+ {
+ device = FromIndex(Map[id]);
+ return true;
+ }
+ else
+ {
+ device = default(T);
+ return false;
+ }
+ }
+
public int Count
{
get { return Map.Count; }