Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

Type.GetInterfaces Method

When overridden in a derived class, gets all the interfaces implemented or inherited by the current Type.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
abstract GetInterfaces : unit -> Type[] 

Return Value

Type: System.Type[]
An array of Type objects representing all the interfaces implemented or inherited by the current Type.
-or-
An empty array of type Type, if no interfaces are implemented or inherited by the current Type.

Implements

_Type.GetInterfaces()
ExceptionCondition
TargetInvocationException

A static initializer is invoked and throws an exception.

The GetInterfaces method does not return interfaces in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which interfaces are returned, because that order varies.

If the current Type represents a constructed generic type, this method returns the Type objects with the type parameters replaced by the appropriate type arguments.

If the current Type represents a type parameter in the definition of a generic type or generic method, this method searches the interface constraints and any interfaces inherited from class or interface constraints.

The following example gets the type of the specified class and displays all the interfaces that the type implements or inherits. To compile the Visual Basic example, use the following compiler commands:

vbc type_getinterfaces1.vb /r:System.Web.dll /r:System.dll

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

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.