Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture   = CultureInfo.InvariantCulture;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

            var data = TablesParser.parse(src);
            var ser  = new XmlSerializerEx(typeof(InstructionsData));

            var destDir = Path.GetDirectoryName(dest);

            if (!Directory.Exists(destDir))
            {
                Directory.CreateDirectory(destDir);
            }

            using (var fs = File.Create(dest))
                ser.Serialize(fs, data);
        }
Exemplo n.º 2
0
        public static InstructionsData parse(string path)
        {
            var excelApp = new Excel.Application();

            excelApp.Visible = false;
            var wb = excelApp.Workbooks.Open(path, null, true);

            try
            {
                var tp = new TablesParser(wb);
                return(tp.result());
            }
            finally
            {
                wb.Close(false);
                excelApp.Quit();
                releaseObject(wb);
                releaseObject(excelApp);
            }
        }