IsSubclassOf Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Determines whether the class represented by the current Type derives from the class represented by the specified Type.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Overridable Function IsSubclassOf ( _
c As Type _
) As Boolean
public virtual bool IsSubclassOf(
Type c
)
public:
virtual bool IsSubclassOf(
Type^ c
)
abstract IsSubclassOf :
c:Type -> bool
override IsSubclassOf :
c:Type -> bool
public function IsSubclassOf(
c : Type
) : boolean
Parameters
- c
Type: System. . :: . .Type
The type to compare with the current type.
Return Value
Type: System. . :: . .Boolean
true 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.
Remarks
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.
This method can be overridden by a derived class.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.