/** * This is where the real things are handled. */ public static int convertFile(string filein, string fileout) { try { XDocument doc = XDocument.Load(filein); STBLWriter stblWriter = new STBLWriter(fileout); int result; if (doc.Root.Name == "TEXT") { result = parseTwallanFormat (doc.Root, stblWriter); } else { result = parseXSTBLFormat (doc.Root, stblWriter); } stblWriter.write (); stblWriter.close (); return result; } catch (System.IO.FileNotFoundException e) { Console.WriteLine (e.Message); return -1; } }