Skip to content

Context Type

Zenvin edited this page Jan 9, 2023 · 1 revision

Type Context

Context representing a single Type instance.
This context is XML-enabled.

This context inherits all properties from TypeContextBase.

Context Properties

Attributes

Returns:
All attributes attached to the represented type.
Type:
SimpleTypeContext

BaseType

Returns:
A context representing the BaseType of the type represented by the current context.
Type:
SimpleTypeContext

Constructors

Returns:
Constructors of the type represented by the current context.
Type:
MethodContext
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which constructors to return. Should include "Constructor" in this case. All
Sort string Criteria by which the returned constructors will be sorted. empty string

Sorting Criteria:

  • AccessModifier
    Sorts by access modifier, by default from least to most accessible.
  • ParameterCount
    Sorts by number of parameters, by default from least to most.

DelegateParameters

Returns:
Parameters used in the type's Invoke method, if the type represent by the context is a delegate.
Otherwise null, resulting in no output.
Type:
ParameterContext

Descendants

Returns:
All types inheriting directly from the represented type.
Type:
SimpleTypeContext

EnumValues

Returns:
All values declared in the type, if the represented type is an enum.
Otherwise null, resulting in no output.
Type:
EnumValueContext

Events

Returns:
Events declared in the represented type.
Type:
EventContext
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which events to return. All
Sort string Criteria by which the returned events will be sorted. empty string

Fields

Returns:
Fields declared in the represented type.
Type:
FieldContext
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which field to return. All
Sort string Criteria by which the returned fields will be sorted. empty string

Implementations

Returns:
Every type implementing type represented by the context, if that type is an interface.
Type:
SimpleTypeContext
Parameters:

Name Type Description Default Value
Sort string Criteria by which the returned events will be sorted. empty string

InheritanceTree

Returns:
All base types preceding the represented type in its inheritance chain, in order.
Type:
SimpleTypeContext
Parameters:

Name Type Description Default Value
IncludeType boolean Whether to include the current type in the chain. true
ExcludeObject boolean Whether to exclude System.Object from the chain. false

Methods

Returns:
Methods declared in the represented type.
Type:
MethodContext
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which methods to return. All
Sort string Criteria by which the returned methods will be sorted. empty string

Properties

Returns:
Properties declared in the represented type.
Type:
PropertyContext
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which properties to return. All
Sort string Criteria by which the returned properties will be sorted. empty string

Condition Properties

The default return value for condition properties in this context is false.

HasAttributes

Returns:
Whether the represented type is decorated with one or multiple attributes.

HasConstructors

Returns:
Whether the represented type contains one or multiple constructors.
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which constructors are considered when evaluating the condition. All

HasDescendants

Returns:
Whether the represented type is used as base type by any other (documented) type.

HasEvents

Returns:
Whether the represented type contains one or multiple events.
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which events are considered when evaluating the condition. All

HasFields

Returns:
Whether the represented type contains one or multiple fields.
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which fields are considered when evaluating the condition. All

HasImplementations

Returns:
Whether the represented type is an interface and is implemented by any other (documented) types.

HasInterfaces

Returns:
Whether the represented type implements one or multiple interfaces.

HasMethods

Returns:
Whether the represented type contains one or multiple methods.
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which methods are considered when evaluating the condition. All

HasProperties

Returns:
Whether the represented type contains one or multiple properties.
Parameters:

Name Type Description Default Value
Filter MemberFilter A filter to determine which properties are considered when evaluating the condition. All
Clone this wiki locally