Strong-Typed Collection Demo

This sample demonstrates the implementation of a custom collection.

Features:

An object for the CustomerCollection class is created and the objects of the Customer class are added using the following code:



                CustomerCollection customers = new CustomerCollection();
                Customer cust1 = ReadCustomer1();
                customers.Add(cust1);  

New customer objects are added as children to the cust1 object using the following code:

                cust1.Children.Add(ReadCustomer3());
                cust1.Children.Add(ReadCustomer4());  

The Customer class implements from the IEditableObject interface.

It has the following fields:

                private CustomerCollection _parentCollection;
                private CustomerCollection _children = new CustomerCollection();
                private CustomerData custData; 
                private CustomerData backupData; 
                private bool beginEditCalled = false;
                private bool modified = false;
                private IEditableObject _forwardEditableObject;  

IList screenshot