-
Notifications
You must be signed in to change notification settings - Fork 0
API Host BondingGetter
将 ClrGetterDelegate 包装为宿主动态 getter 的脚本对象。
Script object wrapper for a ClrGetterDelegate.
命名空间:AuroraScript.Runtime.Types。类型:class。
Namespace:
AuroraScript.Runtime.Types. Kind: class.
Purpose
BondingGetter 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Script object wrapper for a ClrGetterDelegate.
Simple Example
下面是 BondingGetter 的最小使用方式。
A minimal use of
BondingGetter.
ClrGetterDelegate answer = (
ScriptObject target,
ref ScriptDatum result) =>
{
result = ScriptDatum.FromNumber(42);
};
var getter = new BondingGetter(answer);Members
创建 BondingGetter 实例。
Use the member according to its public signature.
Parameters:
-
callback
由运行时调用的回调。Callback invoked by the runtime.
Returns
新建的 BondingGetter 实例。
A new
BondingGetterinstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new BondingGetter(/* 参数 */);读取 Name 字段。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
BondingGetter value = /* 从宿主 API 获取实例 */;
var current = value.Name;调用 Invoke 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
object
要读取或包装的对象。Object to read or wrap.
-
result
接收调用结果的变量。Variable receiving the call result.
Returns
无。
None.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
BondingGetter value = /* 从宿主 API 获取实例 */;
value.Invoke(/* object */, /* result */);AuroraScript.JIT 4.0.0 · 仓库 · MIT 许可
AuroraScript.JIT 4.0.0 · Repository · MIT License