示例#1
0
        private void ProcessFile(string fileName, TinyTranslatorSyncServiceClient service)
        {
            logger.Info("Parse file {0}", fileName);
            String assemblyPath = Path.GetFullPath(fileName);

            Assembly ass = Assembly.LoadFile(assemblyPath);

            AssemblyResourceCollector rc = new AssemblyResourceCollector(ass, CallSyncBundle, CallDeleteBundle);
            rc.CollectResourceAssembly();
            rc.CollectResourceBundles();
            rc.DeleteBundles();
            var statistics = rc.Statistics;

            // Variant that transmits whole DLL
            //var statistics = service.ImportResourceFromAssembly(new FileStream(fileName, FileMode.Open));

            logger.Info("Bundles: {0}/{1}/{2}, Resources: {3}/{4}/{5}",
                statistics.AddedBundles, statistics.UpdatedBundles, statistics.RemovedBundles,
                statistics.AddedResources, statistics.UpdatedResources, statistics.RemovedResources);
        }
 public ResourceSyncStatistics ImportResourcesFromAssembly(int projectID, Assembly assembly)
 {
     IResourceCollector collector = new AssemblyResourceCollector(assembly, SyncBundleCallback, DeleteBundlesClassback);
     return ImportResourcesWithCollector(collector);
 }