public IFileBuilder CreateFileBuilder(NewFileDto newFile) { this._fileName = newFile.FileName; this._fileReaderTypeDto = newFile.FileReaderType; this._encryptionType = newFile.EncryptionType; return(this); }
public IFileReader Create(FileReaderTypeDto fileReaderTypeDto, string fileName) { switch (fileReaderTypeDto) { case FileReaderTypeDto.TextFile: return(new TextFileReader(fileName)); case FileReaderTypeDto.XmlFile: return(new XmlFileReader(fileName)); case FileReaderTypeDto.JsonFile: return(new JsonFileReader(fileName)); default: throw new ArgumentOutOfRangeException(nameof(fileReaderTypeDto), fileReaderTypeDto, null); } }