GetElementType Method
TOC
Collapse the table of content
Expand the table of content

Type.GetElementType Method ()

 

When overridden in a derived class, returns the Type of the object encompassed or referred to by the current array, pointer or reference type.

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

abstract GetElementType : unit -> Type

Return Value

Type: System.Type

The Type of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current Type is not an array or a pointer, or is not passed by reference, or represents a generic type or a type parameter in the definition of a generic type or generic method.

This method returns null for the Array class.

The following example demonstrates using the GetElementType method.

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft