Пример #1
0
        public void ExtractLocalizableItems(ExtractOptions options)
        {
            if (CanOverwriteDirectory(options.DestinationDirectory))
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();

                Console.WriteLine("\nGet original localization files");
                var originalExtractPath = GetOriginalLocalizationFiles(options);

                Console.WriteLine("\nGet actual localization files");
                var actualExtractPath = GetActualLocalizationFiles(options);

                var sourceDir = options.ActualSourceDirectory;
                var destDir   = Path.Combine(options.DestinationDirectory, Routes.DiffExtractDirectory);

                var validator = new ValidateLocalizableExtractor(originalExtractPath, actualExtractPath);
                var extractor = new LocalizableItemsExtractor(sourceDir, destDir, validator, cultures);

                Console.WriteLine("\nExtract vsix");
                extractor.ExtractVsix();

                Console.WriteLine("Extract project templates");
                extractor.ExtractProjectTemplates();

                Console.WriteLine("Extract item templates");
                extractor.ExtractItemTemplates();

                Console.WriteLine("Extract command templates");
                extractor.ExtractCommandTemplates();

                Console.WriteLine("Extract template pages");
                extractor.ExtractTemplatePages();

                Console.WriteLine("Extract template features");
                extractor.ExtractTemplateFeatures();

                Console.WriteLine("Extract template services");
                extractor.ExtractTemplateServices();

                Console.WriteLine("Extract template testings");
                extractor.ExtractTemplateTesting();

                Console.WriteLine("Extract project types");
                extractor.ExtractWtsProjectTypes();

                Console.WriteLine("Extract project frameworks");
                extractor.ExtractWtsFrameworks();

                Console.WriteLine("Extract resources");
                extractor.ExtractResourceFiles();

                Console.WriteLine("End");
                stopwatch.Stop();
                TimeSpan ts = stopwatch.Elapsed;
                Console.WriteLine(string.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
            }
        }
        public void ExtractLocalizableItems(ToolCommandInfo commandInfo)
        {
            if (commandInfo.Arguments == null || commandInfo.Arguments.Length < 3)
            {
                throw new Exception("Error executing command. Too few arguments.");
            }
            string                    sourceDirectory      = commandInfo.Arguments[0];
            string                    destinationDirectory = commandInfo.Arguments[1];
            List <string>             cultures             = new List <string>(commandInfo.Arguments[2].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries));
            LocalizableItemsExtractor extractor            = new LocalizableItemsExtractor(sourceDirectory, destinationDirectory);

            extractor.ExtractVsix(cultures);
            extractor.ExtractProjectTemplates(cultures);
            extractor.ExtractCommandTemplates(cultures);
            extractor.ExtractTemplateEngineTemplates(cultures);
            extractor.ExtractWtsTemplates(cultures);
            extractor.ExtractResourceFiles(cultures);
        }
Пример #3
0
        public void ExtractLocalizableItems(ExtractOptions options)
        {
            if (CanOverwriteDirectory(options.DestinationDirectory))
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();

                var validator = new ValidateLocalizableExtractor(options);
                var extractor = new LocalizableItemsExtractor(options.SourceDirectory, options.DestinationDirectory, cultures, validator);

                Console.WriteLine("\nExtract vsix");
                extractor.ExtractVsix();

                Console.WriteLine("Extract project templates");
                extractor.ExtractProjectTemplates();

                Console.WriteLine("Extract command templates");
                extractor.ExtractCommandTemplates();

                Console.WriteLine("Extract template pages");
                extractor.ExtractTemplatePages();

                Console.WriteLine("Extract template features");
                extractor.ExtractTemplateFeatures();

                Console.WriteLine("Extract project types");
                extractor.ExtractWtsProjectTypes();

                Console.WriteLine("Extract project frameworks");
                extractor.ExtractWtsFrameworks();

                Console.WriteLine("Extract resources");
                extractor.ExtractResourceFiles();

                Console.WriteLine("End");
                stopwatch.Stop();
                TimeSpan ts = stopwatch.Elapsed;
                Console.WriteLine(string.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
            }
        }