Tag Archives: default property

Give a class default indexer properties in C#

An indexer property is a property that other code can use inside square brackets to access some value provided by the class, much as you can use the index of an array. Unlike an array, a class’s indexer need not … Continue reading

Posted in arrays, classes, syntax | Tagged , , , , , , , , , | Leave a comment

Make a default indexer property for a class in C#

Classes such as Dictionary and List provide a default indexer property that lets you access values using a syntax similar to the one you use to access values in an array. For example, the following code sets and then gets … Continue reading

Posted in classes, OOP | Tagged , , , , , , , , , , , , | Leave a comment