private static LocationLangStore loadTags(string inTagFile) { LocationLangStore result = new LocationLangStore(); try { XmlSerializer serializer = new XmlSerializer(typeof(LocationLangStore)); /* If the XML document has been altered with unknown * nodes or attributes, handle them with the * UnknownNode and UnknownAttribute events.*/ serializer.UnknownNode += new XmlNodeEventHandler(serializer_UnknownNode); serializer.UnknownAttribute += new XmlAttributeEventHandler(serializer_UnknownAttribute); using (StreamReader fs = Eviroment.getR_fromAsset(inTagFile)) { // Declare an object variable of the type to be deserialized. /* Use the Deserialize method to restore the object's state with * data from the XML document. */ // Read the order date. result = (LocationLangStore)serializer.Deserialize(fs); } } catch (Exception ex) { log.Debug(ex.StackTrace); GlobalRuntimeMsgsInfoSrv.infoMsg("Error loading language TAGS, loaded defaulf tags"); log.Debug("Init result to empty location store"); result = new LocationLangStore(); } return(result); }
public static void changeToSpa() { locationStore = loadTags(DEFAULT_SPA_LANG_FILE); }
public static void changeToEng() { locationStore = loadTags(DEFAULT_ENG_LANG_FILE); }