Retrieves the class that declares this member.
[Visual Basic] MustOverride Public ReadOnly Property DeclaringType As Type [C#] public Type DeclaringType {abstract get;} [C++] public: __property virtual Type* get_DeclaringType() = 0; [JScript] public abstract function get DeclaringType() : Type;
Read-only.
The Type object for the class that declares this member.
The DeclaringType property retrieves a reference to the Type object for the type that declares this member. A member of a class (or interface) is either declared or inherited from a base class (or interface). The returned class may not be the same as the Type object used to obtain this MemberInfo object.
Note the example shown has a returned type of Empty and Object from a MemberInfo object from a System.Empty class.
class Mymemberinfo{ public static int Main() { Console.WriteLine ("\nReflection.MemberInfo");
MemberInfo Class | MemberInfo Members | System.Reflection Namespace