
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Filtering Output When Obtaining Members
|
775
o = new Object( );
po = new Object( );
}
#endregion
The output this generates is listed here:
Looking for All Constructors
Found Constructor .cctor
Found Constructor .ctor
Found Constructor .ctor
Looking for Public Instance Constructors
Found Constructor .ctor
Looking for NonPublic Constructors
Found Constructor .cctor
Found Constructor .ctor
Looking for Public, Static Fields
Found Field psi
Found Field pso
Looking for Public Fields
Found Field pi
Found Field po
Found Field psi
Found Field pso
Looking for NonPublic, Static Fields
Found Field si
Found Field so
Discussion
The following methods of the Type object accept a BindingFlags enumerator to filter
output:
Type.GetConstructor
Type.GetConstructors
Type.GetMethod
Type.GetMethods
Type.GetField
Type.GetFields
Type.GetProperty
Type.GetProperties
Type.Event
Type.Events
Type.GetMember
Type.GetMembers
Type.FindMembers
The following are also methods that accept a BindingFlags enumerator to filter mem-
bers and types to invoke or instantiate:
Type.InvokeMember
Type.CreateInstance
BindingFlags allows the list of members on which these methods operate to be
expanded or limited. For example, if the
BindingFlags.Public flag is passed to the