public UploadHandler(ISaveFiles fileSaver, IEncrypt encryptor, IUnzip unzipper, IMakeWebRequests webRequester) { _fileSaver = fileSaver; _encryptor = encryptor; _unzipper = unzipper; _webRequester = webRequester; }
public DownloadManager(ILogCreator logCreator, IJsonManager jsonManager, IDirectorio directorio, ISaveFiles saveFiles, ISerializacion serializacion) { _logger = logCreator.GetTipoLogger <frmDescargas>(); _jsonManager = jsonManager; _directorio = directorio; _saveFiles = saveFiles; _serializacion = serializacion; }
/// <summary> /// Try to save the plugin state into a temporary destination. /// </summary> /// <param name="saveState">The plugin state to save.</param> /// <param name="temporaryContainer">The temporary destination the state will be saved in.</param> /// <param name="fileName">The name of the initial file.</param> /// <param name="saveInfo">The context for the save operation.</param> /// <returns>The result of the save state process.</returns> private async Task <SaveResult> TrySaveState(ISaveFiles saveState, IFileSystem temporaryContainer, string fileName, SaveInfo saveInfo) { try { var saveContext = new SaveContext(saveInfo.Progress); await Task.Run(async() => await saveState.Save(temporaryContainer, fileName, saveContext)); } catch (Exception ex) { return(new SaveResult(ex)); } return(SaveResult.SuccessfulResult); }