Delegate Constructor (Type, String)

Initializes a delegate that invokes the specified static method from the specified class.

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

protected Delegate (
	Type target,
	string method
)
protected Delegate (
	Type target, 
	String method
)
protected function Delegate (
	target : Type, 
	method : String
)

Parameters

target

The Type representing the class that defines method.

method

The name of the static 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

target is not a RuntimeType. See Runtime Types in Reflection.

-or-

target represents an open generic type.

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

This constructor creates delegates for static 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.

To get the Type that represents a class, use the Type.GetType method with the fully qualified (including namespace) name of the class. For example, passing "System.Threading.ThreadStart" to Type.GetType returns a Type for the ThreadStart class.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: