Mega Code Archive

 
Categories / C# Tutorial / Reflection
 

Commonly used methods defined by Type

Method Purpose ConstructorInfo[ ] GetConstructors()Obtains a list of the constructors. EventInfo[ ] GetEvents()Obtains a list of events. FieldInfo[ ] GetFields()Obtains a list of the fields. MemberInfo[ ] GetMembers()Obtains a list of the members. MethodInfo[ ] GetMethods()Obtains a list of methods. PropertyInfo[ ] GetProperties()Obtains a list of properties. Here are several commonly used, read-only properties defined by Type: PropertyPurpose Assembly AssemblyObtains the assembly. TypeAttributes AttributesObtains the attributes. Type BaseTypeObtains the immediate base type. string FullNameObtains the complete name. bool IsAbstractIs abstract. bool isArrayIs an array. bool IsClassIs a class. bool IsEnumIs an enumeration. string NamespaceObtains the namespace.