public static ArchiveCreated ArchiveText(this IArchiveService service, string name, string content, Action <ArchiveOptions> options = null) { if (service == null) { throw new ArgumentNullException("service"); } ArchiveCreated archiveCreated = null; using (BeginArchive beginArchive = service.Create(name, (ArchiveCreated x) => archiveCreated = x)) { if (options != null) { options(beginArchive.Options); } beginArchive.IncludeContent(name, content, null); } return(archiveCreated); }
public static ArchiveCreated ArchiveText(this IArchiveService service, string name, string content, Action <ArchiveOptions> options = null) { if (service == null) { throw new ArgumentNullException(nameof(service)); } ArchiveCreated created = null; using (BeginArchive archive = service.Create(name, x => created = x)) { options?.Invoke(archive.Options); archive.IncludeContent(name, content); } return(created); }