public void Inject(UiInjectionManager manager) { if (_leafs.Length == 0) { return; } String root = _source.ProvideRootDirectory(); String targetDirectory = Path.Combine(root, _listing.ExtractionSubpath); if (!_source.DirectoryIsExists(targetDirectory)) { return; } foreach (WpdEntry entry in _leafs) { String targetPath = Path.Combine(targetDirectory, entry.NameWithoutExtension); Inject(entry, targetPath); } if (_injected) { List <ArchiveEntry> entries = new List <ArchiveEntry>(2); MemoryInjectionSource memorySource = new MemoryInjectionSource(); if (_headers.IsValueCreated) { ArchiveEntry entry = _listing.Accessor.HeadersEntry; entries.Add(entry); memorySource.RegisterStream(entry.Name, _headers.Value); } if (_content.IsValueCreated) { ArchiveEntry entry = _listing.Accessor.ContentEntry; entries.Add(entry); memorySource.RegisterStream(entry.Name, _content.Value); } using (UiArchiveInjector injector = new UiArchiveInjector(_listing.Accessor.Parent, entries.ToArray(), _conversion, false, memorySource)) injector.Inject(manager); manager.Enqueue(_listing.Accessor.Parent); } }
public void Inject(UiInjectionManager manager) { if (_leafs.Length == 0) return; String root = _source.ProvideRootDirectory(); String targetDirectory = Path.Combine(root, _listing.ExtractionSubpath); if (!_source.DirectoryIsExists(targetDirectory)) return; foreach (WpdEntry entry in _leafs) { String targetPath = Path.Combine(targetDirectory, entry.NameWithoutExtension); Inject(entry, targetPath); } if (_injected) { List<ArchiveEntry> entries = new List<ArchiveEntry>(2); MemoryInjectionSource memorySource = new MemoryInjectionSource(); if (_headers.IsValueCreated) { ArchiveEntry entry = _listing.Accessor.HeadersEntry; entries.Add(entry); memorySource.RegisterStream(entry.Name, _headers.Value); } if (_content.IsValueCreated) { ArchiveEntry entry = _listing.Accessor.ContentEntry; entries.Add(entry); memorySource.RegisterStream(entry.Name, _content.Value); } using (UiArchiveInjector injector = new UiArchiveInjector(_listing.Accessor.Parent, entries.ToArray(), _conversion, false, memorySource)) injector.Inject(manager); manager.Enqueue(_listing.Accessor.Parent); } }
public void Inject(IUiInjectionSource source, UiInjectionManager manager) { using (UiArchiveInjector injector = new UiArchiveInjector(_listing, _leafs, _conversion, _compression, source)) injector.Inject(manager); }