void _worker_DoWork(object sender, DoWorkEventArgs e) { var storage = SharpBoxSupport.OpenDropBoxStorage(); try { while (_pendingTasks.Count > 0) { var task = _pendingTasks.Dequeue(); task(storage); } storage.Close(); } catch (Exception ex) { Logger.Error(ex.ToString()); } finally { if (storage != null) { storage.Close(); } } }
public static void CreateFoldersForAlbum(this CloudStorage storage, string albumId) { storage.CreateFolder(SharpBoxSupport.GetThumbVirtualPath(albumId)); storage.CreateFolder(SharpBoxSupport.GetPhotoVirtualPath(albumId)); storage.CreateFolder(SharpBoxSupport.GetDownloadVirtualPath(albumId)); }
public static ICloudDirectoryEntry EnsureDownloadFolder(this CloudStorage storage, string albumId) { return(storage.GetFolderEx(SharpBoxSupport.GetDownloadVirtualPath(albumId))); }