private IEditingService GetViewingServiceForOptions(IStorageProvider customStorageProvider,
                                                 IStorageProvider customTempStorageProvider,
                                                 SupportedStorageProvider storageProvider,
                                                 Hashtable options,
                                                 string rootStoragePath, string workingFolder)
        {
            IEditingService viewingService;
            if (customStorageProvider == null)
            {
                switch (storageProvider)
                {
                    case SupportedStorageProvider.Local:
                        viewingService = new EditingService(rootStoragePath, workingFolder);
                        break;
                    default:
                        object sourceBucketNameObject = null, cacheBucketNameObject = null;
                        string sourceBucketName = null, cacheBucketName = null;
                        if (options != null)
                        {
                            sourceBucketNameObject = options[CommonConstants.BucketNameKey];
                            if (sourceBucketNameObject != null)
                                sourceBucketName = (string) sourceBucketNameObject;

                            cacheBucketNameObject = options[CommonConstants.CacheBucketNameKey];
                            if (cacheBucketNameObject != null)
                            {
                                cacheBucketName = (string) cacheBucketNameObject;
                                options[CommonConstants.DownloadFolderForCacheStorageKey] = Path.Combine(_downloadPath,
                                                                                                         cacheBucketName);
                            }
                            options[CommonConstants.CacheFolderKey] = Path.Combine(_downloadPath, sourceBucketName);
                        }
                        viewingService = new EditingService(rootStoragePath, (byte) storageProvider, options,
                                                            cacheBucketName);
                        break;
                }
            }
            else
            {
                viewingService = GetViewingService(rootStoragePath, customStorageProvider, workingFolder, customTempStorageProvider);
            }
            return viewingService;
        }
 public IEditingService GetViewingService(string rootStoragePath,
                                          IStorageProvider customStorageProvider,
                                          string workingDirectoryPath, 
                                          IStorageProvider customWorkingStorageProvider)
 {
     IFileStorage adapter = new FileStorageAdapter(customStorageProvider);
     IFileStorage tempStorageAdapter = new FileStorageAdapter(customWorkingStorageProvider);
     IEditingService viewingService = new EditingService(rootStoragePath, adapter, workingDirectoryPath, tempStorageAdapter);
     return viewingService;
 }