O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Strongly-Typed Collection

The collections you have been looking at in this chapter are generic in that they can store heterogeneous instances of any object type or boxed value type. Most likely, you might need to create a collection that stores data of only one type. This is called a strongly typed collection.

Descending from CollectionBase

The System.Collections namespace contains an abstract class, CollectionBase, from which your custom collection might descend in order to create strongly-typed collections. Internally, the CollectionBase uses an ArrayList instance to store elements. Access to the ArrayList is through an IList interface provided by the List property. CollectionBase also defines the methods that need to be overridden ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required