Skip to content

API Host BooleanValue

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

BooleanValue

不可变的脚本布尔值包装类型。

Immutable script boolean wrapper.

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

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

返回 .NET Host API 参考

用途

BooleanValue 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。

Immutable script boolean wrapper.

简单示例

下面是 BooleanValue 的最小使用方式。

A minimal use of BooleanValue.

var enabled = BooleanValue.Of(true);

Console.WriteLine(enabled.Value); // True

成员

static readonly BooleanValue True

读取 True 字段。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 BooleanValue

Returns BooleanValue.

调用示意

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

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

var current = BooleanValue.True;

static readonly BooleanValue False

读取 False 字段。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 BooleanValue

Returns BooleanValue.

调用示意

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

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

var current = BooleanValue.False;

bool Value

读取 Value 字段。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 bool

Returns bool.

调用示意

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

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

BooleanValue value = /* 从宿主 API 获取实例 */;
var current = value.Value;

int IntValue

读取 IntValue 字段。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 int

Returns int.

调用示意

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

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

BooleanValue value = /* 从宿主 API 获取实例 */;
var current = value.IntValue;

StringValue StrValue

读取 StrValue 字段。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 StringValue

Returns StringValue.

调用示意

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

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

BooleanValue value = /* 从宿主 API 获取实例 */;
var current = value.StrValue;

static BooleanValue Of(bool value)

调用 Of 完成其公开操作。

Use the member according to its public signature.

Parameters:

  • value
    要处理、保存或转换的值。

    Value to process, store, or convert.

Returns

返回 BooleanValue

Returns BooleanValue.

调用示意

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

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

var result = BooleanValue.Of(/* value */);

Clone this wiki locally