public void CopyFrom(GeneralObject go)
{
//复制实体类型
if (go.entityType != null)
{
EntityType = go.EntityType;
}
foreach (string key in go._customPropertyValues.Keys)
{
object value = go._customPropertyValues[key];
//是列表,进行列表复制
if (value is BaseObjectList)
{
//如果列表不存在,新建列表
if (!_customPropertyValues.ContainsKey(key) || _customPropertyValues[key] == null)
{
ObjectList ol = new ObjectList();
SetPropertyValue(key, ol, true);
}
ObjectList nol = (ObjectList)_customPropertyValues[key];
nol.CopyFrom(value as BaseObjectList);
}
//是对象,进行对象复制
else if (value is GeneralObject)
{
SetPropertyValue(key, value, true);
////对象不存在,新建对象
//if (!_customPropertyValues.ContainsKey(key) || _customPropertyValues[key] == null)
//{
// GeneralObject obj = new GeneralObject();
// SetPropertyValue(key, obj, true);
//}
////进行对象复制
//GeneralObject ngo = (GeneralObject)_customPropertyValues[key];
//ngo.CopyFrom((GeneralObject)value);
}
//是一般属性,调用设置属性值的过程
else
{
this.NewGetType();
SetPropertyValue(key, value, true);
}
}
}