MemberInfo.ReflectedType Property gets the class object that was used to obtain this instance of MemberInfo. : MethodInfo « Reflection « VB.Net






MemberInfo.ReflectedType Property gets the class object that was used to obtain this instance of MemberInfo.

 

Imports System
Imports System.Reflection

Module Example

    Sub Main()

        Dim m1 As MemberInfo = GetType(Object).GetMethod("ToString")
        Dim m2 As MemberInfo = GetType(MemberInfo).GetMethod("ToString")

        Console.WriteLine("m1.DeclaringType: {0}", m1.DeclaringType)
        Console.WriteLine("m1.ReflectedType: {0}", m1.ReflectedType)

        Console.WriteLine("m2.DeclaringType: {0}", m2.DeclaringType)
        Console.WriteLine("m2.ReflectedType: {0}", m2.ReflectedType)

    End Sub
End Module

   
  








Related examples in the same category

1.MethodInfo.GetBaseDefinition
2.MethodInfo.MemberType Property indicates that this member is a method.
3.MethodInfo.ReturnType gets the return type of this method.
4.MemberInfo Class contains information about the attributes of a member
5.Display the set of assemblies our assemblies reference
6.Display information about each assembly loading into this AppDomain.
7.Get members from a Type
8.MemberInfo.DeclaringType Property gets the class that declares this member.
9.MemberInfo.GetCustomAttributes
10.MemberInfo.MemberType indicates the type of the member, method, constructor, event.
11.MemberInfo.Module Property gets the module
12.MemberInfo.Name gets the name of the current member.
13.PropertyInfo Class represents the attributes of a property and provides access to property metadata.