PropertyDescriptor.GetInvocationTarget(Type, Object) 方法

定义

此方法返回应在成员调用期间使用的对象。This method returns the object that should be used during invocation of members.

protected:
 override System::Object ^ GetInvocationTarget(Type ^ type, System::Object ^ instance);
protected override object GetInvocationTarget (Type type, object instance);
override this.GetInvocationTarget : Type * obj -> obj
Protected Overrides Function GetInvocationTarget (type As Type, instance As Object) As Object

参数

type
Type

调用目标的 TypeThe Type of the invocation target.

instance
Object

潜在的调用目标。The potential invocation target.

返回

Object

应在成员调用期间使用的 ObjectThe Object that should be used during invocation of members.

注解

通常,返回值将与传入的 instance 相同。Typically, the return value will be the same as the instance passed in. 如果某人将其他对象与此实例相关联,或者如果该实例为自定义类型描述符,则 GetInvocationTarget 方法可能返回不同的值。If someone associated another object with this instance, or if the instance is a custom type descriptor, the GetInvocationTarget method may return a different value.

适用于