public bool TryInject(IUiInjectionSource source, string sourceFullPath, ArchiveEntryInjectionData data, ArchiveEntry entry) { Dictionary <string, string> sourceEntries; using (Stream input = source.TryOpen(sourceFullPath)) { if (input != null) { string entryName; ZtrTextReader reader = new ZtrTextReader(input, StringsZtrFormatter.Instance); sourceEntries = reader.Read(out entryName).ToDictionary(e => e.Key, e => e.Value); using (Stream output = data.OuputStreamFactory(entry)) Inject(data.Listing, entry, sourceEntries, output); return(true); } } sourceEntries = source.TryProvideStrings(); if (sourceEntries == null) { return(false); } using (Stream output = data.OuputStreamFactory(entry)) Inject(data.Listing, entry, sourceEntries, output); return(true); }
public UiWpdInjector(WpdArchiveListing listing, WpdEntry[] leafs, bool? conversion, IUiInjectionSource source) { _listing = listing; _leafs = leafs; _source = source; _conversion = conversion; _injectors = ProvideInjectors(); _headers = new Lazy<Stream>(AcquireHeaders); _content = new Lazy<Stream>(AcquireContent); }
public UiArchiveInjector(ArchiveListing listing, ArchiveEntry[] leafs, bool? conversion, bool? compression, IUiInjectionSource source) { _listing = listing; _leafs = leafs; _source = source; _conversion = conversion; _compression = compression; _injectionData = new ArchiveEntryInjectionData(_listing, OpenOutputStream); _injectors = ProvideInjectors(); }
public UiWpdInjector(WpdArchiveListing listing, WpdEntry[] leafs, bool?conversion, IUiInjectionSource source) { _listing = listing; _leafs = leafs; _source = source; _conversion = conversion; _injectors = ProvideInjectors(); _headers = new Lazy <Stream>(AcquireHeaders); _content = new Lazy <Stream>(AcquireContent); }
public UiArchiveInjector(ArchiveListing listing, ArchiveEntry[] leafs, bool?conversion, bool?compression, IUiInjectionSource source) { _listing = listing; _leafs = leafs; _source = source; _conversion = conversion; _compression = compression; _injectionData = new ArchiveEntryInjectionData(_listing, OpenOutputStream); _injectors = ProvideInjectors(); }
public bool TryInject(IUiInjectionSource source, string sourceFullPath, ArchiveEntryInjectionData data, ArchiveEntry entry) { using (Stream input = source.TryOpen(sourceFullPath)) { if (input == null) return false; using (Stream output = data.OuputStreamFactory(entry)) input.CopyToStream(output, (int)input.Length, data.Buffer); return true; } }
public bool TryInject(IUiInjectionSource source, string sourceFullPath, ArchiveEntryInjectionData data, ArchiveEntry entry) { using (Stream input = source.TryOpen(sourceFullPath)) { if (input == null) { return(false); } using (Stream output = data.OuputStreamFactory(entry)) input.CopyToStream(output, (int)input.Length, data.Buffer); return(true); } }
public bool TryInject(IUiInjectionSource source, string sourceFullPath, ArchiveEntryInjectionData data, ArchiveEntry entry) { Dictionary<string, string> sourceEntries; using (Stream input = source.TryOpen(sourceFullPath)) { if (input != null) { string entryName; ZtrTextReader reader = new ZtrTextReader(input, StringsZtrFormatter.Instance); sourceEntries = reader.Read(out entryName).ToDictionary(e => e.Key, e => e.Value); using (Stream output = data.OuputStreamFactory(entry)) Inject(data.Listing, entry, sourceEntries, output); return true; } } MemoryInjectionSource memorySource = source as MemoryInjectionSource; if (memorySource == null) return false; sourceEntries = memorySource.TryProvideStrings(); if (sourceEntries == null) return false; using (Stream output = data.OuputStreamFactory(entry)) Inject(data.Listing, entry, sourceEntries, output); return true; }
public void Inject(IUiInjectionSource source, UiInjectionManager manager) { using (UiWpdInjector injector = new UiWpdInjector(_listing, _leafs, _conversion, source)) injector.Inject(manager); }
public void Inject(IUiInjectionSource source, UiInjectionManager manager) { using (UiArchiveInjector injector = new UiArchiveInjector(_listing, _leafs, _conversion, _compression, source)) injector.Inject(manager); }
public void Inject(IUiInjectionSource source, UiInjectionManager manager) { throw new NotImplementedException(); //using (UiWpdInjector injector = new UiWpdInjector(_listing, _leafs, _conversion, source)) // injector.Inject(manager); }