Lets say I want to create a Document object. Within that Document object there can be any number of Field objects. Each Field has its own methods and properties. I want to be able to create a collection of Fields that can be accessed from the Document object.
Q1: Should I write the Field class as a subclass of the Document class. (I don't think I'll use the Field object outside the context of a Document.) Q2: How do implement the Field class as a collection? (i've looked at MSDN, and while it tells me that my Field
class should inherit the CollectionBase class, I don't understand how you would make that available through the Document object. e.g. "Document.Field.Item()") Q3: Would I need a Field object and a Fields object to facilitate a field and a collection of fields?
Any help very much appretiated.
Kalym
Member
25 Points
5 Posts
How to use collections? (C# Newbie)
Aug 27, 2003 09:27 PM|LINK