Type::BaseType Property

Gets the type from which the current Type directly inherits.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

No code example is currently available or this language may not be supported.

Property Value

Type: System::Type
The Type from which the current Type directly inherits, or nullptr if the current Type represents the Object class or an interface.

The base type is the type from which the current type directly inherits. Object is the only type that does not have a base type, therefore nullptr is returned as the base type of Object.

Interfaces inherit from zero or more base interfaces; therefore, this property returns nullptr if the Type object represents an interface. The base interfaces can be determined with GetInterfaces.

If the current Type represents a constructed generic type, the base type reflects the generic arguments. For example, consider the following declarations:

generic<typename U> ref class B { };
generic<typename T> class C : B<T> { };

For the constructed type C<int> (C(Of Integer) in Visual Basic), the BaseType property returns B<int>.

If the current Type represents a type parameter of a generic type definition, BaseType returns the class constraint, that is, the class the type parameter must inherit. If there is no class constraint, BaseType returns System::Object.

This property is read-only.

The following example demonstrates using the BaseType property.

No code example is currently available or this language may not be supported.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: