コード例 #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;
        }
コード例 #2
0
 /// <summary>
 /// Disconnect from the device
 /// </summary>
 public void Disconnect()
 {
     CheckConnected(true);
     connected = false;
     try
     {
         using (camera)
             camera.Exit(context);
     }
     finally
     {
         camera = null;
     }
 }
コード例 #3
0
ファイル: Camera.cs プロジェクト: zyh329/libgphoto2-sharp
 /// <summary>
 /// Disconnect from the device
 /// </summary>
 public void Disconnect()
 {
     CheckConnected(true);
     connected = false;
     try
     {
         using (camera)
             camera.Exit(context);
     }
     finally
     {
         camera = null;
     }
 }
コード例 #4
0
ファイル: Camera.cs プロジェクト: zyh329/libgphoto2-sharp
        /// <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;
        }