Esempio n. 1
0
 /**
  * <summary>Convert a simple DYM2 into a text file.</summary>
  * <param name="inputPath">The input file.</param>
  */
 private static void Convert(String inputPath)
 {
     try
     {
         String outputPath = inputPath.Substring(0, inputPath.LastIndexOf(".") - 1) + ".txt";
         SimpleFileConverterTask.Convert(inputPath, outputPath);
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine("Command failed with error: \"" + ex.Message + "\"");
         Environment.Exit(1);
     }
 }
Esempio n. 2
0
        /////////////////////////////////////////////////////////////////////////////////

        /**
         * <summary>Convert a simple DYM2 into a text file.</summary>
         * <param name="inputPath">Path to the input file.</param>
         * <param name="outputPath">Path to the output file.</param>
         */
        public static void Convert(String inputPath, String outputPath)
        {
            using (SimpleFileConverterTask writer = new SimpleFileConverterTask(outputPath))
            {
                Console.Out.WriteLine(String.Format("Converting: {0}", inputPath));
                Dym2Reader reader = new Dym2Reader(inputPath);
                reader.AddObserver(writer);
                reader.Read();
                //
                Console.Out.WriteLine(String.Format("Exported: {0}/{1}", writer.exportedCells, writer.totalExports));
                Console.Out.WriteLine("-----------------------------------------------");
            }
        }