Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Disconnect from the device
 /// </summary>
 public void Disconnect()
 {
     CheckConnected(true);
     connected = false;
     try
     {
         using (camera)
             camera.Exit(context);
     }
     finally
     {
         camera = null;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Disconnect from the device
 /// </summary>
 public void Disconnect()
 {
     CheckConnected(true);
     connected = false;
     try
     {
         using (camera)
             camera.Exit(context);
     }
     finally
     {
         camera = null;
     }
 }
Ejemplo n.º 4
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;
        }