Share via


DeclaringType Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the class that declares this member.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public MustOverride ReadOnly Property DeclaringType As Type
public abstract Type DeclaringType { get; }
public:
virtual property Type^ DeclaringType {
    Type^ get () abstract;
}
abstract DeclaringType : Type with get
abstract function get DeclaringType () : Type

Property Value

Type: System. . :: . .Type
The Type object for the class that declares this member.

Remarks

The DeclaringType property retrieves a reference to the Type object for the type that declares this member. A member of a type is either declared by the type or inherited from a base type, so the Type object returned by the DeclaringType property might not be the same as the Type object used to obtain the current MemberInfo object.

  • If the Type object from which this MemberInfo object was obtained did not declare this member, the DeclaringType property will represent one of its base types.

  • If the MemberInfo object is a global member (that is, if it was obtained from the Module.GetMethods method, which returns global methods on a module), the returned DeclaringType will be null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

.NET Framework Security

See Also

Reference

MemberInfo Class

System.Reflection Namespace