MulticastDelegate Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the MulticastDelegate class.
MulticastDelegate(Object, String) |
Initializes a new instance of the MulticastDelegate class. |
MulticastDelegate(Type, String) |
Initializes a new instance of the MulticastDelegate class. |
- Source:
- MulticastDelegate.cs
- Source:
- MulticastDelegate.cs
- Source:
- MulticastDelegate.cs
Initializes a new instance of the MulticastDelegate class.
protected:
MulticastDelegate(System::Object ^ target, System::String ^ method);
protected MulticastDelegate (object target, string method);
new MulticastDelegate : obj * string -> MulticastDelegate
Protected Sub New (target As Object, method As String)
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 9 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 |
.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 |
- Source:
- MulticastDelegate.cs
- Source:
- MulticastDelegate.cs
- Source:
- MulticastDelegate.cs
Initializes a new instance of the MulticastDelegate class.
protected:
MulticastDelegate(Type ^ target, System::String ^ method);
protected MulticastDelegate (Type target, string method);
new MulticastDelegate : Type * string -> MulticastDelegate
Protected Sub New (target As Type, method As String)
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 9 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 |
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: