ReflectionContext 类

定义

表示可以提供反射对象的上下文。Represents a context that can provide reflection objects.

public ref class ReflectionContext abstract
public abstract class ReflectionContext
type ReflectionContext = class
Public MustInherit Class ReflectionContext
继承
ReflectionContext
派生

注解

此类的目的是提供一种在反射对象出自默认反射上下文而不是默认反射上下文的情况下感知反射代码的方法,以便对这些对象执行的操作可以使用该上下文。The purpose of this class is to provide a way for reflection code to be made aware when reflection objects originate in a context other than the default reflection context, so that operations on those objects can use that context. 例如,使用对象的反射对象 CustomReflectionContext 只应与具有相同源的反射对象进行比较。For example, reflection objects that originate with a CustomReflectionContext object should be compared only with reflection objects that have the same origin. 有关详细信息,请参阅 CustomReflectionContext 引用页。For more information, see the CustomReflectionContext reference page.

构造函数

ReflectionContext()

初始化 ReflectionContext 类的新实例。Initializes a new instance of the ReflectionContext class.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetTypeForObject(Object)

获取本反射上下文中特定对象的类的表示形式。Gets the representation of the type of the specified object in this reflection context.

MapAssembly(Assembly)

在此反射上下文中,获取由另一反射上下文对象表示的程序集表示形式。Gets the representation, in this reflection context, of an assembly that is represented by an object from another reflection context.

MapType(TypeInfo)

让此反射上下文中某种类型的表现形式由另一反射上下文中的对象表示。Gets the representation, in this reflection context, of a type represented by an object from another reflection context.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于