public void Print(FileInfo filename, Encoding fileEncoding, IContentParameters parameters) { if (filename == null) { throw new ArgumentNullException("filename cannot be null", "filename"); } if (fileEncoding == null) { throw new ArgumentNullException("encoding", "encoding cannot be null"); } if (parameters == null) { throw new ArgumentNullException("parameters", "parameters cannot be null"); } this.CurrentEncoding = fileEncoding; IFileContentReader fileReader = new FileContentReader(filename.Name); var readedBytes = fileReader.ReadAllAsByte(); IContentReplacer replacer = new ContentReplacer(parameters, fileEncoding); var result = replacer.Replace(readedBytes); if (result != null) { Print(result); } }
public void Print(FileInfo payloadFile) { if (payloadFile == null) { throw new ArgumentNullException("payloadFile", "payloadFile cannont be null"); } IFileContentReader reader = new FileContentReader(payloadFile.Name); Print(reader.ReadAllAsByte()); }