private CustomerList MakeCustomerList(Customer c, int count) { CustomerList customerList = new CustomerList(); for (int i = 0; i < count; i++) { Customer cust = (Customer)c.Clone(); customerList.Add(cust); } return customerList; }
private void btnClone_Click(object sender, System.EventArgs e) { if (IsValidData()) { int count = Convert.ToInt16(txtCopies.Text); customers = MakeCustomerList(customer, count); lstCustomers.Items.Clear(); foreach (Customer c in customers) { lstCustomers.Items.Add(c.GetDisplayText()); } } }
public void HandleChanged(CustomerList customerList) { // Is not supposed to do anything - its just so one event is bound already - so we dont have to // check if we're already bound, or deal with other things that may be bound. - In the future tho that // would probably be better etiquette. }