GetPropertyString() public method

public GetPropertyString ( string key ) : string
key string
return string
Exemplo n.º 1
0
        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);
        }
	public void ImportUdi (string udi)
	{
		/* probably a camera we need to contruct on of our gphoto2 uris */
		Hal.Device dev = new Hal.Device (Core.HalContext, udi);
		string mount_point = dev.GetPropertyString ("volume.mount_point");
		int bus = dev.GetPropertyInt ("usb.bus_number");
		int device = dev.GetPropertyInt ("usb.linux.device_number");
		System.Console.WriteLine ("dev = {1} exists = {2} mount_point = {0} {3},{4}", mount_point, dev, dev.Exists, bus, device);

		if (! dev.Exists || mount_point != null) {
			ImportFile (mount_point);
		} else {
			string gphoto_uri = String.Format ("gphoto2:usb:{0},{1}", bus.ToString ("d3") , device.ToString ("d3"));
			System.Console.WriteLine ("gphoto_uri = {0}", gphoto_uri);
			ImportCamera (gphoto_uri);
		} 
			
	}