Sunday, August 9, 2009

Chapter 14-Lesson 3

  • GetTypes( ) method on an Assembly objects returns all types (classes) in all the Modules of the Assembly.
  • However, the same method may be called on a Module class to get all the types present in that particualr Module.
  • The GetType( ) method or typeof keyword (in C#) may be used over an object to ask it about its type.
  • The Fullname property of the Type class gets a fully qualified name for the Type, without the assembly information.
  • GetCustomAttributes( ) method may also be used over Type class.
  • See "What type is that Object?" on page 858.
  • MemberInfo is an abstract class and all other ...Info classes derive from it.
  • The Type class also derives from MemberInfo class.
  • MemberInfo -> MethodBase -> MethodInfo is the inheritance hierarchy for MethodInfo and ConstructorInfo classes.
  • MemberType enumeration defines possible types of members.
  • By default, the Get...( ) methods return only public members within a Type.
  • To have more control while getting members of a type, we use BindingFlags enumeration. e.g. to get protected, internal and private members, use BindingFlags.NonPublic.
  • We may use more than one BindingFlag values (using operator) during a Get...( ) method call.
  • MethodBody class represents IL Code and local variables for a particular MethodBase object.

No comments:

Post a Comment