示例#1
0
        /// <summary>
        /// Reads the object of type t from stream
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        public static T ReadFromStream <T>(Stream stream)
            where T : class
        {
            XmlDocument document = new XmlDocument();

            document.Load(stream);
            var xmlDeseralizer = new BallisticXmlDeserializer();

            return(xmlDeseralizer.Deserialize <T>(document.DocumentElement));
        }
 /// <summary>
 /// Deserialize a ballistic XML object of type `T` from the stream.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="stream"></param>
 /// <returns></returns>
 public static T BallisticXmlDeserialize <T>(this Stream stream)
     where T : class
 => BallisticXmlDeserializer.ReadFromStream <T>(stream);