Example #1
0
        private static void DoCsvToSourceSync(string fn, bool isSync, Parser parser)
        {
            //read in CSV and write to MXE if we found a change
            Console.Out.WriteLine("Reading in CSV data...");
            if (parser.ReadCsvs() && isSync)
            {
                Console.Out.WriteLine("Backup Source file and then Writing out Source data to [" + fn + "]...");

                // back up the mxe file with a .bak file
                int    fileCount = -1;
                string backup    = fn + ".bak";
                do
                {
                    fileCount++;
                }while (File.Exists(backup + (fileCount > 0 ? fileCount.ToString() : String.Empty)));

                File.Copy(fn, backup + (fileCount > 0 ? fileCount.ToString() : String.Empty));
                // write out the changed data
                parser.Write();
            }
        }
Example #2
0
        private static void DoCsvToSourceSync(string fn, bool isSync, Parser parser)
        {
            //read in CSV and write to MXE if we found a change
            Console.Out.WriteLine("Reading in CSV data...");
            if (parser.ReadCsvs() && isSync)
            {
                Console.Out.WriteLine("Backup Source file and then Writing out Source data to [" + fn + "]...");

                // back up the mxe file with a .bak file
                int fileCount = -1;
                string backup = fn + ".bak";
                do
                {
                    fileCount++;
                }
                while (File.Exists(backup + (fileCount > 0 ? fileCount.ToString() : String.Empty)));

                File.Copy(fn, backup + (fileCount > 0 ? fileCount.ToString() : String.Empty));
                // write out the changed data
                parser.Write();
            }
        }