Delegate.Target 属性

定义

获取类实例,当前委托将对其调用实例方法。Gets the class instance on which the current delegate invokes the instance method.

public:
 property System::Object ^ Target { System::Object ^ get(); };
public object Target { get; }
public object? Target { get; }
member this.Target : obj
Public ReadOnly Property Target As Object

属性值

Object

如果委托表示实例方法,则为当前委托对其调用实例方法的对象;如果委托表示静态方法,则为 nullThe object on which the current delegate invokes the instance method, if the delegate represents an instance method; null if the delegate represents a static method.

注解

实例方法是与类的实例关联的方法;静态方法是与类自身相关联的方法。An instance method is a method that is associated with an instance of a class; a static method is a method that is associated with the class itself.

如果委托调用一个或多个实例方法,此属性将返回调用列表中最后一个实例方法的目标。If the delegate invokes one or more instance methods, this property returns the target of the last instance method in the invocation list.

适用于