public static LangXml Load(Object file) { TextReader reader; try { Stream str = file as Stream; if (str != null) { reader = new StreamReader(str); } else { reader = new StreamReader(file.ToString()); } } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); return(null); } LangXml value = null; XmlSerializer serializer = new XmlSerializer(typeof(LangXml)); try { value = (LangXml)serializer.Deserialize(reader); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } finally { reader.Close(); } return(value); }
public void Load(Object file) { ListtoDict(LangXml.Load(file).Trans, ref langxml); }