Пример #1
0
        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);
        }
Пример #2
0
 public void Load(Object file)
 {
     ListtoDict(LangXml.Load(file).Trans, ref langxml);
 }