Example #1
0
        /// <summary>
        /// Reads a TextProvider item from an Xml document
        /// </summary>
        /// <param name="dom">The XmlDocument containing the object</param>
        /// <returns>A TextProvider object</returns>
        public static TextProvider Deserialize(XmlDocument dom)
        {
            XmlNode data = dom.ChildNodes[1];

            TextProvider text = new TextProvider();

            text.m_Language = data.Attributes["language"].Value;

            foreach (XmlNode section in data.ChildNodes)
            {
                string topkey = section.Attributes["name"].Value;

                Dictionary<string, string> hash = new Dictionary<string, string>();

                foreach (XmlNode entry in section.ChildNodes)
                {
                    string lowkey = entry.Attributes["name"].Value;
                    string t = entry.Attributes["text"].Value;

                    hash.Add(lowkey, t);
                }

                text.m_Sections.Add(topkey, hash);
            }

            return text;
        }