class Employee ICloneable
{
public string IDCode {get;set;}
public int Age {get;set;}
public DepartmentDepartment {get;set;}
#region ICloneable成员
public object Clone()
{
using (Stream objectstream new Memorystream())
{
IFormatter formatter new BinaryFormatter();
formatter.Serialize(objectstream,this);
objectstream.Seek(0,Seekorigin.Begin);
return formatter.Deserialize(objectstream)as Employee; #endregion
}
}
#endregion
}