日期:2014-05-16 浏览次数:20938 次
public bool DeSerialize<T>(ref List<T> pEntityLis, ref T pEntity, string pEntityString)
{
这里头,如何初始化pEntity,原因是,我必须循环反系列化到pEntity,然后Add到pEntityLis
}
public bool DeSerialize<T>(ref List<T> pEntityLis, ref T pEntity, string pEntityString) where T:new()
{
T t=new T();
这里头,如何初始化pEntity,原因是,我必须循环反系列化到pEntity,然后Add到pEntityLis
}
public interface IEntity
{
string Name{get;set;}
}
public bool DeSerialize<T>(ref List<T> pEntityLis, ref T pEntity, string pEntityString) where T:IEntity,new()
{
T t=new T();
t.Name="hello";
这里头,如何初始化pEntity,原因是,我必须循环反系列化到pEntity,然后Add到pEntityLis
}
T defaultValue = default(T);
public struct clone<valueType>
{
private static readonly func<valueType, object> copyer;
public static valueType MemberwiseClone(valueType value)
{
return (valueType)copyer(value);
}
static clone()
{
copyer = (func<valueType, object>)Delegate.CreateDelegate(typeof(func<valueType, object>), typeof(valueType).GetMethod("MemberwiseClone", System.Reflection.BindingFlags.Instance
------解决方案--------------------
System.Reflection.BindingFlags.NonPublic));
}
}
public bool DeSerialize<T>(ref List<T> pEntityLis, ref T pEntity, string pEntityString) where T: new()
{
&n