Exemplo 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;
        }
Exemplo n.º 2
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;
        }