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