At run time my program assign 2 properties with same collection. I took two properties so that if changing to collection will be done by one property and second will hold the same collection as it is. But behind the scene both are pointing to same, i can not hold the collection with no changes to one property. I require this to wok this ok and cancel button so that if no changes one prperty will take care or this, and if changes done the other property wil take care of this.
How can i manage this?
like this
private void btnOK_Click(object sender, EventArgs e)
{
Program.currOrder.OrderItems[Program.editIndex].AppliedCustomization = lstBtn;//objFreecusatomization.AllAppliedItems;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void btnCancel_Click(object sender, EventArgs e)
{
Program.currOrder.OrderItems[Program.editIndex].AppliedCustomization = actualBtnLIst;
this.DialogResult = DialogResult.Cancel;
}
these are the 2 properties which are being assined from some other program
public List<btnObject> lstBtn;
public List<btnObject> actualBtnLIst { get; set; }
from other program this is how it is set
frmPrepare.actualBtnLIst = frmPrepare.lstBtn = Program.currOrder.OrderItems[currIdx].AppliedCustomization;