コード例 #1
0
 public UploadHandler(ISaveFiles fileSaver, IEncrypt encryptor, IUnzip unzipper, IMakeWebRequests webRequester)
 {
     _fileSaver    = fileSaver;
     _encryptor    = encryptor;
     _unzipper     = unzipper;
     _webRequester = webRequester;
 }
コード例 #2
0
 public DownloadManager(ILogCreator logCreator, IJsonManager jsonManager, IDirectorio directorio, ISaveFiles saveFiles, ISerializacion serializacion)
 {
     _logger        = logCreator.GetTipoLogger <frmDescargas>();
     _jsonManager   = jsonManager;
     _directorio    = directorio;
     _saveFiles     = saveFiles;
     _serializacion = serializacion;
 }
コード例 #3
0
        /// <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);
        }