MATLAB 中的 .NET 事件和委托
通过委托可以告知 C# 当事件触发时调用哪个方法。事件是由 .NET 给出的告知某操作已发生的通知。下列主题说明如何在 MATLAB® 中使用 .NET 事件和委托。
函数
BeginInvoke | 启动异步 .NET 委托调用 |
EndInvoke | 检索 .NET System.Delegate BeginInvoke 方法启动的异步调用结果 |
Combine | 静态 .NET System.Delegate.Combine 方法的便利函数 |
Remove | 用于 .NET System.Delegate Remove 静态方法的便利函数 |
RemoveAll | 用于 .NET System.Delegate RemoveAll 静态方法的便利函数 |
主题
- Use .NET Events in MATLAB
These examples use the
addlistener
function to handle .NET events with MATLAB callbacks. - Call .NET Delegates in MATLAB
This example shows you how to use a delegate in MATLAB.
- Create Delegates from .NET Object Methods
This example shows how to create a delegate.
- Create Delegate Instances Bound to .NET Methods
This example shows how to use delegate instances.
- Combine and Remove .NET Delegates
This example shows how to manage delegates.
- 事件和侦听程序概述
使用事件和侦听程序发送和响应消息。
- .NET Delegates
In .NET, a delegate is a type that defines a method signature.
- .NET Delegates With out and ref Type Arguments
The MATLAB rules for mapping
out
andref
types for delegates are the same as for methods. - Calling .NET Methods Asynchronously
How MATLAB handles asynchronous method calls.
疑难解答
Limitations to Support of .NET Events
.NET features not supported in MATLAB.
Limitations to Support of .NET Delegates
.NET features not supported in MATLAB.