>That can be implemented in the Data class
>In the Clone() method - first do the MemberWiseClone(), then copy the dataset
>
http://msdn.microsoft.com/en-us/library/system.icloneable(v=vs.110).aspx>
>
>Notes to Implementers
>The ICloneable interface simply requires that your implementation of the Clone method return a copy of the current object instance. It does not specify whether the cloning operation performs a deep copy, a shallow copy, or something in between.
>>
>
> class Test_Clone
> {
> internal static void Go()
> {
>
> Data d = new Data();
> // do some changes to d.oDataSet
>
> Data cloned = d.Clone() as Data;
> }
> }
>
> class Data : ICloneable
> {
> internal DataSet oDataSet = new DataSet();
> internal int Count = 4;
>
> public object Clone()
> {
> Data cloned = (Data) MemberwiseClone();
> cloned.oDataSet = cloned.oDataSet.Copy();
>
> return cloned;
> }
> }
>
That is a very interesting approach. Thanks