예제 #1
0
        private void Inject(WpdArchiveListing listing, WpdEntry[] fontEntries, WflContent[] fontContent)
        {
            UiInjectionManager manager = new UiInjectionManager();

            using (MemoryInjectionSource source = new MemoryInjectionSource())
            {
                String injectionRoot = Path.Combine(source.ProvideRootDirectory(), listing.ExtractionSubpath);
                for (int i = 0; i < fontEntries.Length; i++)
                {
                    WpdEntry   entry         = fontEntries[i];
                    WflContent content       = fontContent[i];
                    String     injectionPath = Path.Combine(injectionRoot, entry.Name);

                    MemoryStream stream = new MemoryStream(1024);
                    source.RegisterStream(injectionPath, stream);

                    WflFileWriter writer = new WflFileWriter(stream);
                    writer.Write(content);
                    stream.SetPosition(0);
                }

                UiWpdInjector injector = new UiWpdInjector(listing, fontEntries, false, source);
                injector.Inject(manager);
            }
            manager.WriteListings();
        }
예제 #2
0
        public static void InjectSingle(WpdArchiveListing listing, WpdEntry entry, MemoryStream output)
        {
            using (MemoryInjectionSource source = new MemoryInjectionSource())
            {
                source.RegisterStream(String.Empty, output);
                UiWpdInjector injector = new UiWpdInjector(listing, new[] {entry}, false, source);

                UiInjectionManager manager = new UiInjectionManager();
                injector.Inject(manager);
                manager.WriteListings();
            }
        }
예제 #3
0
        public static void InjectSingle(WpdArchiveListing listing, WpdEntry entry, MemoryStream output)
        {
            using (MemoryInjectionSource source = new MemoryInjectionSource())
            {
                source.RegisterStream(String.Empty, output);
                UiWpdInjector injector = new UiWpdInjector(listing, new[] { entry }, false, source);

                UiInjectionManager manager = new UiInjectionManager();
                injector.Inject(manager);
                manager.WriteListings();
            }
        }
예제 #4
0
 public void Inject(IUiInjectionSource source, UiInjectionManager manager)
 {
     using (UiWpdInjector injector = new UiWpdInjector(_listing, _leafs, _conversion, source))
         injector.Inject(manager);
 }
예제 #5
0
 public void Inject(IUiInjectionSource source, UiInjectionManager manager)
 {
     using (UiWpdInjector injector = new UiWpdInjector(_listing, _leafs, _conversion, source))
         injector.Inject(manager);
 }