private void ProcessFiles(string[] args) { service = new TinyTranslatorSyncServiceClient(); foreach (String arg in args) { // expand wildcards int lastBackslashPos = arg.LastIndexOf('\\') + 1; String path = arg.Substring(0, lastBackslashPos); String fileNameOnly = arg.Substring(lastBackslashPos, arg.Length - lastBackslashPos); String[] fileList = Directory.GetFiles(path, fileNameOnly); foreach (String fileName in fileList) ProcessFile(fileName, service); } logger.Info("Program finished successfully"); }
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); }