Exemplo n.º 1
0
        static private bool Process(string filePath, string[] outputExtensions)
        {
            string workingDirectory = Directory.GetCurrentDirectory();

            string rootedFilePath = Path.IsPathRooted(filePath) ? filePath : Path.Combine(workingDirectory, filePath);
            var    file           = new FileInfo(rootedFilePath);

            if (!file.Exists)
            {
                System.Console.WriteLine($"Error: {file.FullName} not found !");
                return(false);
            }

            var converter = new DastFileConverter();

            ExtensionsLoader.FromAssemblies(GetAssemblies(), converter);

            Stopwatch stopWatch = Stopwatch.StartNew();

            converter.Convert(rootedFilePath, workingDirectory, outputExtensions);

            stopWatch.Stop();
            System.Console.WriteLine(stopWatch.Elapsed.TotalSeconds);

            return(true);
        }