Поделиться через


System.Reflection Namespace

Microsoft Silverlight will reach end of support after October 2021. Learn more.

The System.Reflection namespace contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata. These types also can be used to manipulate instances of loaded types, for example, to hook up events or to invoke methods. To dynamically create types, use the System.Reflection.Emit namespace.

Classes

  Class Description
Public class AmbiguousMatchException The exception that is thrown when binding to a member results in more than one member matching the binding criteria. This class cannot be inherited.
Public class Assembly Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.
Public class AssemblyAlgorithmIdAttribute Specifies an algorithm to hash all files in an assembly. This class cannot be inherited.
Public class AssemblyCompanyAttribute Defines a company name custom attribute for an assembly manifest.
Public class AssemblyConfigurationAttribute Specifies the build configuration, such as retail or debug, for an assembly.
Public class AssemblyCopyrightAttribute Defines a copyright custom attribute for an assembly manifest.
Public class AssemblyCultureAttribute Specifies which culture the assembly supports.
Public class AssemblyDefaultAliasAttribute Defines a friendly default alias for an assembly manifest.
Public class AssemblyDelaySignAttribute Specifies that the assembly is not fully signed when created.
Public class AssemblyDescriptionAttribute Provides a text description for an assembly.
Public class AssemblyFileVersionAttribute Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number.
Public class AssemblyFlagsAttribute Specifies a bitwise combination of AssemblyNameFlags flags for an assembly, describing just-in-time (JIT) compiler options, whether the assembly is retargetable, and whether it has a full or tokenized public key. This class cannot be inherited.
Public class AssemblyInformationalVersionAttribute Defines additional version information for an assembly manifest.
Public class AssemblyKeyFileAttribute Specifies the name of a file containing the key pair used to generate a strong name.
Public class AssemblyKeyNameAttribute Specifies the name of a key container within the CSP containing the key pair used to generate a strong name.
Public class AssemblyName Describes an assembly's unique identity in full.
Public class AssemblyProductAttribute Defines a product name custom attribute for an assembly manifest.
Public class AssemblyTitleAttribute Specifies a description for an assembly.
Public class AssemblyTrademarkAttribute Defines a trademark custom attribute for an assembly manifest.
Public class AssemblyVersionAttribute Specifies the version of the assembly being attributed.
Public class Binder Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.
Public class ConstructorInfo Discovers the attributes of a class constructor and provides access to constructor metadata.
Public class CustomAttributeFormatException The exception that is thrown when the binary format of a custom attribute is invalid.
Public class DefaultMemberAttribute Defines the member of a type that is the default member used by InvokeMember.
Public class EventInfo Discovers the attributes of an event and provides access to event metadata.
Public class FieldInfo Discovers the attributes of a field and provides access to field metadata.
Public class LocalVariableInfo Discovers the attributes of a local variable and provides access to local variable metadata.
Public class MemberInfo Obtains information about the attributes of a member and provides access to member metadata.
Public class MethodBase Provides information about methods and constructors.
Public class MethodInfo Discovers the attributes of a method and provides access to method metadata.
Public class Missing Represents a missing Object. This class cannot be inherited.
Public class Module Performs reflection on a module.
Public class ParameterInfo Discovers the attributes of a parameter and provides access to parameter metadata.
Public class PropertyInfo Discovers the attributes of a property and provides access to property metadata.
Public class ReflectionTypeLoadException The exception that is thrown by the Module.GetTypes method if any of the classes in a module cannot be loaded. This class cannot be inherited.
Public class TargetException Represents the exception that is thrown when an attempt is made to invoke an invalid target.
Public class TargetInvocationException The exception that is thrown by methods invoked through reflection. This class cannot be inherited.
Public class TargetParameterCountException The exception that is thrown when the number of parameters for an invocation does not match the number expected. This class cannot be inherited.
Public class TypeDelegator Wraps a Type object and delegates all methods to that Type.

Structures

  Structure Description
Public structure InterfaceMapping Retrieves the mapping of an interface into the actual methods on a class that implements that interface.
Public structure ParameterModifier Attaches a modifier to parameters so that binding can work with parameter signatures in which the types have been modified.

Interfaces

  Interface Description
Public interface ICustomAttributeProvider Provides custom attributes for reflection objects that support them.
Public interface ICustomTypeProvider Defines a method that returns a custom Type object used by the data binding system to determine the run-time structure of the implementing type.
Public interface IReflect Interoperates with the IDispatch interface.

Delegates

  Delegate Description
Public delegate MemberFilter Represents a delegate that is used to filter a list of members represented in an array of MemberInfo objects.

Enumerations

  Enumeration Description
Public enumeration AssemblyNameFlags Provides information about an Assembly reference.
Public enumeration BindingFlags Specifies flags that control binding and the way in which the search for members and types is conducted by reflection.
Public enumeration CallingConventions Defines the valid calling conventions for a method.
Public enumeration EventAttributes Specifies the attributes of an event.
Public enumeration FieldAttributes Specifies the attributes of a field.
Public enumeration GenericParameterAttributes Describes the constraints on a generic type parameter of a generic type or method.
Public enumeration MemberTypes Marks each type of member that is defined as a derived class of MemberInfo.
Public enumeration MethodAttributes Specifies flags for method attributes. These flags are defined in the corhdr.h file.
Public enumeration MethodImplAttributes Specifies flags for the attributes of a method implementation.
Public enumeration ParameterAttributes Defines the attributes that can be associated with a parameter. These are defined in CorHdr.h.
Public enumeration PropertyAttributes Defines the attributes that can be associated with a property.
Public enumeration ResourceAttributes Specifies the attributes for a manifest resource.
Public enumeration TypeAttributes Specifies type attributes.