.net中的浅拷贝和深拷贝
摘要:
public T Clone(bool isDeepCopy){T t;if (isDeepCopy){MemoryStream memoryStream = new MemoryStream();BinaryFormatter formatter = new BinaryFormatter();formatter.Serialize(memoryStream,this);memoryStream.Position = 0;t= (T)formatter.Deserialize(memoryStream);}elset= (T)this.MemberwiseClone();return t;. 阅读全文
posted @ 2012-11-30 23:33 铭天 阅读(196) 评论(0) 推荐(0) 编辑