/// <summary> /// 从流中读取文本,解析出类型 <paramref name="type"/> 的对象。 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="reader"></param> /// <returns></returns> public T Deserialize <T>(XmlTextReader reader) { using (var deser = new XmlDeserialize(this, reader, Option)) { return(deser.Deserialize <T>()); } }
public object Deserialize(string xml, Type type) { if (string.IsNullOrEmpty(xml)) { return(null); } using (var sr = new StringReader(xml)) using (var reader = XmlReader.Create(sr)) using (var deser = new XmlDeserialize(this, reader, Option)) { return(deser.Deserialize(type)); } }
public T Deserialize <T>(string xml) { if (string.IsNullOrEmpty(xml)) { return(default(T)); } using (var sr = new StringReader(xml)) using (var reader = XmlReader.Create(sr)) using (var deser = new XmlDeserialize(this, reader, Option)) { return(deser.Deserialize <T>()); } }