public static void loadContent(String file) { try { baseFileContent = System.IO.Path.GetDirectoryName(file); try { StreamReader sr = new StreamReader(file); String line; ContentParser cont; while ((line = sr.ReadLine()) != null) { try { cont = new ContentParser(); if (cont.startParse(baseFileNpcs + line)) { Data.IrisData.addScript(cont.script); } } catch (Exception e) { //e.ToString(); } } } catch (Exception e) { //e.ToString(); } } catch (Exception e) { //fichier inexistant } }
public MainWindow() { InitializeComponent(); ContentParser cont = new ContentParser(); ScriptParser scriptPars = new ScriptParser(); if (cont.startParse(System.IO.Path.GetFullPath("characters/fate.txt"))) { scr = cont.script; scr.addContent(); } else { System.Windows.MessageBox.Show("Fail Characters"); } try { LexerParser lexpars = new LexerParser(); if (lexpars.startParse(System.IO.Path.GetFullPath("new_bidon.txt"))) { scr = lexpars.script; scr.addContent(); ev = new ScriptEval(gScreen); } else { System.Windows.MessageBox.Show("Fail"); } } catch (Exception e) { System.Windows.MessageBox.Show(e.ToString()); System.Windows.MessageBox.Show(e.StackTrace); } }