The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MemberInfo.ReflectedType Property

Gets the class object that was used to obtain this instance of MemberInfo.

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

Public MustOverride ReadOnly Property ReflectedType As Type
Dim instance As MemberInfo
Dim value As Type

value = instance.ReflectedType

/** @property */
public abstract Type get_ReflectedType ()

public abstract function get ReflectedType () : Type

Property Value

The Type object through which this MemberInfo object was obtained.

The ReflectedType property retrieves the Type object that was used to obtain this instance of MemberInfo. A MemberInfo object represents a member of a particular class or interface.

In order to obtain a MethodInfo object:

  • The Type object that represents the class or interface that supports the method is queried. This property holds a reference to that Type object.

  • If the reflected type is the same class as the declaring class, the member is defined on the declaring class, not on a base class.

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

The following example gets ReflectedType property for the specified type.

Imports System
Imports System.IO
Imports System.Reflection
Imports Microsoft.VisualBasic

Class Mymemberinfo

    Public Shared Sub Main()

        Console.WriteLine(ControlChars.Cr & "Reflection.MemberInfo")

        ' Get the Type and MemberInfo.
        Dim MyType As Type = Type.GetType("System.IO.BufferedStream")
        Dim Mymemberinfoarray As MemberInfo() = MyType.GetMembers()

        ' Get and display the DeclaringType method.
        Console.WriteLine(ControlChars.Cr & "There are {0} members in {1}:", _
           Mymemberinfoarray.Length, MyType.FullName)

        Dim Mymemberinfo As MemberInfo
        For Each Mymemberinfo In Mymemberinfoarray
            Console.WriteLine(ControlChars.Cr & Mymemberinfo.Name _
               & " reflected type - " & Mymemberinfo.ReflectedType.ToString())
        Next Mymemberinfo
    End Sub
End Class

import System.*;
import System.IO.*;
import System.Reflection.*;

class MyMemberInfo
    public static void main(String[] args)

        // Get the Type and MemberInfo.
        Type myType = Type.GetType("System.IO.BufferedStream");
        MemberInfo myMemberInfoArray[] = myType.GetMembers();

        // Get and display the DeclaringType method.
        Console.Write("\nThere are {0} members in ",
        Console.Write("{0}.", myType.get_FullName());
        for (int iCtr = 0; iCtr < myMemberInfoArray.length ; iCtr++ ) {
            MemberInfo myMemberInfo = myMemberInfoArray[iCtr];
            Console.Write(("\n" + myMemberInfo.get_Name() 
                + " reflected type - " + myMemberInfo.get_ReflectedType()));
    } //main
} //MyMemberInfo

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft