public DeepCopyClient() { DeepCopy dc1 = new DeepCopy(); DeepCopy dc2 = (DeepCopy)dc1.Clone(); dc1.v[0] = 9; dc1.Display(); dc2.Display(); }
private void ShowDeepCopy() { DeepCopy sc = new DeepCopy(); sc.MessageModel = new MessageModel("DeepCopy", DateTime.Now); DeepCopy sc2 = (DeepCopy)sc.Clone(); Response.Write(sc.MessageModel.Message); Response.Write("<br />"); Response.Write(sc2.MessageModel.Message); Response.Write("<br />"); sc.MessageModel.Message = "DeepCopyDeepCopy"; Response.Write(sc.MessageModel.Message); Response.Write("<br />"); Response.Write(sc2.MessageModel.Message); Response.Write("<br />"); }