public static UsbDevice Resolve (Hal.Manager manager, Hal.Device device) { if (device["info.subsystem"] == "usb_device" && device.PropertyExists ("usb_device.product_id") && device.PropertyExists ("usb_device.vendor_id")) { return new UsbDevice (manager, device); } return null; }
private bool IsMounted(Hal.Device device) { try { if (!device.PropertyExists ("volume.mount_point")) return false; } catch { return false; } string mountPoint = device.GetPropertyString ("volume.mount_point"); return mountPoint != null && mountPoint != String.Empty; }
private bool IsIPod(Hal.Device device) { return device.PropertyExists ("org.podsleuth.version"); }