Discovering Type Information

The System.Type class is the primary means by which type metadata is accessed. It provides an API that will allow you to manipulate newly discovered types. A System.Type object instance can represent all .NET languages types, including classes, interfaces, arrays, values, and enumerations.

First, you will need to get a reference to a System.Type object instance. There are several different ways to do this. In this section we will discuss two of the most popular.

Retrieving Type Information with the GetType Method

The easiest way to get a reference to a System.Type object instance is to call the GetType method on an already existing object instance. The GetType method is a public virtual method declared on the Object ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.