Sitecore 5.1.1 API

MainUtil.IsType Method (Type, Type)

Checks if an object is of a given type

[Visual Basic]
Overloads Public Shared Function IsType( _
   ByVal objType As Type, _
   ByVal ancestorType As Type _
) As Boolean
[C#]
public static bool IsType(
   Type objType,
   Type ancestorType
);

Return Value

True if the object is of the type, otherwise false.

Remarks

This function is analog to the "is" operator.

The function performs the following checks:

  1. Is the type of object equivalent to the type.
  2. Is the object a subclass of the type.
  3. If the type is an interface, does the object implement it.

See Also

MainUtil Class | Sitecore Namespace | MainUtil.IsType Overload List