BeginInvoke |
Initiate asynchronous .NET delegate call |
EndInvoke |
Retrieve result of asynchronous call initiated by .NET System.Delegate BeginInvoke method |
Combine |
方便为静态的。net系统功能。Delegate Combine method |
Remove |
方便为静态的。net系统功能。Delegate Remove method |
RemoveAll |
方便为静态的。net系统功能。Delegate RemoveAll method |
These examples use theaddlistener
function to handle .NET events with MATLAB®callbacks.
This example shows you how to use a delegate in MATLAB.
Create Delegates from .NET Object Methods
The following C# class defines the methodsAddEggs
andAddFlour
, which have signatures matching thedelInteger
delegate:
Create Delegate Instances Bound to .NET Methods
For a C# delegate defined as:
Combine and Remove .NET Delegates
MATLAB provides the instance methodCombine
, that lets you combine a series of delegates into a single delegate.
Use events and listeners to send and respond to messages.
In the .NET Framework, adelegateis a type that defines a method signature.
.NET Delegates With out and ref Type Arguments
The MATLAB rules for mappingout
andref
types for delegates are the same as for methods.
Calling .NET Methods Asynchronously
It is possible to call a synchronous method asynchronously in MATLAB.
Limitations to Support of .NET Events
An event handler in C# is a delegate with the following signature:
Limitations to Support of .NET Delegates
MATLAB does not support associating a delegate instance with a generic .NET method.