Ejemplo n.º 1
0
 /// <summary>
 /// 将文本转换为对象
 /// </summary>
 /// <param name="streamObject">文本字符串</param>
 /// <param name="types">需要用到的对象类型</param>
 /// <returns>对象</returns>
 public static object Deserialize <T>(T streamObject)
 {
     if (!(DefaultSerializer is ISerialize <T>))
     {
         throw new Exception("默认的序列化器不支持此类型的反序列化").AddExceptionData("Type", typeof(T));
     }
     return(DefaultSerializer.As <ISerialize <T> >().Deserialize(streamObject));
 }