1 public object Clone(bool doDeepCopy)
2 {
3 if (doDeepCopy)
4 {
5 BinaryFormatter BF = new BinaryFormatter();
6 MemoryStream memStream = new MemoryStream();
7 BF.Serialize(memStream, this);
8 memStream.Flush();
9 memStream.Position = 0;
10 return (BF.Deserialize(memStream));
11 }
12 else
13 {
14 return (this.MemberwiseClone());
15 }
16 }
17
18 public object Clone()
19 {
20 return (Clone(true));
21 }