C
craig
Assume that you would like to create a custom collection class that is:
1. Strongly-typed (only holds Customer objects)
2. Read-only (user cannot add Customer objects)
3. Able to be bound to a winforms datagrid (must implement the IList
interface).
What would be a good way to create this class?
1. The CollectionBase abstract base class can be used, but it is not
read-only.
2. The ReadOnlyCollection abstract base class can be used, but it doesn't
implement IList and therefore can't be bound.
3. The IList interface includes an "IsReadOnly" property, so why does the
ReadOnlyCollection base class
not implement the IList interface, with IsReadOnly set to return "true"??
(Instead, it doesn't implement IList at all).
1. Strongly-typed (only holds Customer objects)
2. Read-only (user cannot add Customer objects)
3. Able to be bound to a winforms datagrid (must implement the IList
interface).
What would be a good way to create this class?
1. The CollectionBase abstract base class can be used, but it is not
read-only.
2. The ReadOnlyCollection abstract base class can be used, but it doesn't
implement IList and therefore can't be bound.
3. The IList interface includes an "IsReadOnly" property, so why does the
ReadOnlyCollection base class
not implement the IList interface, with IsReadOnly set to return "true"??
(Instead, it doesn't implement IList at all).