Skip to content

API Host BondingGetter

Liu.Yandong.Hanks edited this page Aug 19, 2026 · 2 revisions

BondingGetter

ClrGetterDelegate 包装为宿主动态 getter 的脚本对象。

Script object wrapper for a ClrGetterDelegate.

命名空间:AuroraScript.Runtime.Types。类型:class。

Namespace: AuroraScript.Runtime.Types. Kind: class.

返回 .NET Host API 参考

Back to .NET Host API Reference

用途

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(ClrGetterDelegate callback)

创建 BondingGetter 实例。

Use the member according to its public signature.

Parameters:

  • callback
    由运行时调用的回调。

    Callback invoked by the runtime.

Returns

新建的 BondingGetter 实例。

A new BondingGetter instance.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

var value = new BondingGetter(/* 参数 */);

string Name

读取 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;

void Invoke(ScriptObject @object, ref ScriptDatum result)

调用 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 */);

Clone this wiki locally