MulticastDelegate Constructors

Definition

Initializes a new instance of the MulticastDelegate class.

Overloads

MulticastDelegate(Object, String)

Initializes a new instance of the MulticastDelegate class.

MulticastDelegate(Type, String)

Initializes a new instance of the MulticastDelegate class.

MulticastDelegate(Object, String)

Source:
MulticastDelegate.cs
Source:
MulticastDelegate.cs
Source:
MulticastDelegate.cs

Initializes a new instance of the MulticastDelegate class.

C#
protected MulticastDelegate(object target, string method);

Parameters

target
Object

The object on which method is defined.

method
String

The name of the method for which a delegate is created.

Exceptions

Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism.

Remarks

This constructor cannot be used in application code. To create a delegate by specifying the name of an instance method, use an overload of the Delegate.CreateDelegate method that specifies a method name and a target object. For example, the Delegate.CreateDelegate(Type, Object, String) method overload creates a delegate for an instance method with a specified name.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MulticastDelegate(Type, String)

Source:
MulticastDelegate.cs
Source:
MulticastDelegate.cs
Source:
MulticastDelegate.cs

Initializes a new instance of the MulticastDelegate class.

C#
protected MulticastDelegate(Type target, string method);

Parameters

target
Type

The type of object on which method is defined.

method
String

The name of the static method for which a delegate is created.

Exceptions

Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism.

Remarks

This constructor cannot be used in application code. To create a delegate by specifying the name of a static method, use an overload of the Delegate.CreateDelegate method that specifies a method name but does not specify a target object. For example, the Delegate.CreateDelegate(Type, Type, String) method overload creates a static delegate for a method with a specified name.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1