Esempio n. 1
0
        static internal AuthorityData FromXml(string xml)
        {
            // Compensate for stupid Mono encoding bugs

            if (xml.StartsWith("?"))
            {
                xml = xml.Substring(1);
            }

            xml = xml.Replace("�", "");
            xml = xml.Replace("\x00", "");

            XmlSerializer serializer = new XmlSerializer(typeof(AuthorityData));

            MemoryStream stream = new MemoryStream();

            byte[] xmlBytes = Encoding.UTF8.GetBytes(xml);
            stream.Write(xmlBytes, 0, xmlBytes.Length);

            stream.Position = 0;
            AuthorityData result = (AuthorityData)serializer.Deserialize(stream);

            stream.Close();

            return(result);
        }
Esempio n. 2
0
 public static Authority FromXml(string xml)
 {
     return(new Authority(AuthorityData.FromXml(xml)));
 }
Esempio n. 3
0
 private Authority(AuthorityData data)
 {
     this._data = data;
 }