Export (0) Print
Expand All

Delegate.Delegate(Object, String) Constructor

Initializes a delegate that invokes the specified instance method on the specified class instance.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

protected Delegate (
	Object target,
	string method
)
protected Delegate (
	Object target, 
	String method
)
protected function Delegate (
	target : Object, 
	method : String
)
Not applicable.

Parameters

target

The class instance on which the delegate invokes method.

method

The name of the instance method that the delegate represents.

Exception typeCondition

ArgumentNullException

target is a null reference (Nothing in Visual Basic).

-or-

method is a null reference (Nothing in Visual Basic).

ArgumentException

There was an error binding to the target method.

This constructor is called by a compiler-generated delegate type to create a delegate based on the name of an instance method and an instance of the class that defines that method.

This constructor creates delegates for instance methods only. 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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft