Пример #1
0
        /// <summary>
        /// Connect to the device
        /// </summary>
        public void Connect()
        {
            CheckConnected(false);
            camera = new LibGPhoto2.Camera();
            camera.SetAbilities(baseAbilities);
            camera.SetPortInfo(port);
            camera.Init(context);
            try
            {
                LibGPhoto2.CameraStorageInformation[] storages = camera.GetStorageInformation(Context);
                fileSystems = new List <FileSystem>(storages.Length);
                for (int i = 0; i < storages.Length; i++)
                {
                    fileSystems.Add(new FileSystem(this, storages[i]));
                }

                DetectPaths();
            }
            catch
            {
                camera.Exit(context);
                throw;
            }
            connected = true;
        }
	public void SelectCamera (int index)
	{
		selected_camera__camera_list_index = index;

		selected_camera__abilities_list_index = abilities_list.LookupModel (camera_list.GetName (selected_camera__camera_list_index));			
		camera_abilities = abilities_list.GetAbilities (selected_camera__abilities_list_index);

		camera = new Camera ();
		camera.SetAbilities (camera_abilities);

		
		string path  = camera_list.GetValue (selected_camera__camera_list_index);
		System.Console.WriteLine ("Testing gphoto path = {0}", path);
		selected_camera__port_info_list_index = port_info_list.LookupPath (path);

		port_info = port_info_list.GetInfo (selected_camera__port_info_list_index);
		System.Console.WriteLine ("PortInfo {0}, {1}", port_info.Name, port_info.Path);

		camera.SetPortInfo (port_info);
	}
Пример #3
0
        /// <summary>
        /// Connect to the device 
        /// </summary>
        public void Connect()
        {
            CheckConnected(false);
            camera = new LibGPhoto2.Camera();
            camera.SetAbilities(baseAbilities);
            camera.SetPortInfo(port);
            camera.Init(context);
            try
            {
                LibGPhoto2.CameraStorageInformation[] storages = camera.GetStorageInformation(Context);
                fileSystems = new List<FileSystem>(storages.Length);
                for (int i = 0; i < storages.Length; i++)
                    fileSystems.Add(new FileSystem(this, storages[i]));

                DetectPaths();
            }
            catch
            {
                camera.Exit(context);
                throw;
            }
            connected = true;
        }