Advertisement

Advanced C# Type Construction Techniques

Abstract

In this chapter, you’ll deepen your understanding of the C# programming language by examining a number of advanced (but still quite useful) syntactic constructs. To begin, you’ll learn how to construct and use an indexer method. This C# mechanism enables you to build custom types that provide access to internal subtypes using an array-like syntax. Once you learn how to build an indexer method, you’ll then examine how to overload various operators (+, −, <, >, and so forth), and create custom explicit and implicit conversion routines for your types (and you’ll learn why you may wish to do so).

Keywords

Indexer Method Pointer Type Static Void Class Program Public Struct 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Andrew Troelsen 2007

Personalised recommendations