Type::IsSubclassOf Method
Assembly: mscorlib (in mscorlib.dll)
Parameters
- c
- Type: System::Type
The Type to compare with the current Type.
Return Value
Type: System::Booleantrue if the Type represented by the c parameter and the current Type represent classes, and the class represented by the current Type derives from the class represented by c; otherwise, false. This method also returns false if c and the current Type represent the same class.
Implements
_Type::IsSubclassOf(Type)| Exception | Condition |
|---|---|
| ArgumentNullException | The c parameter is nullptr. |
The IsSubclassOf method cannot be used to determine whether an interface derives from another interface, or whether a class implements an interface. Use the GetInterface method for that purpose. Note that if a type is dervived from an interface, this method returns true for that type being a subclass of Object.
If the current Type represents a type parameter in the definition of a generic type or generic method, it derives from its class constraint or from System::Object if it has no class constraint.
Note: |
|---|
If the IsSubclassOf is the converse of IsAssignableFrom. That is, if t1.IsSubclassOf(t2) is true, then t2.IsAssignableFrom(t1) is also true. |
This method can be overridden by a derived class.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: