Skip to content

API Host RuntimeOptionsBuilder

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

RuntimeOptionsBuilder

EngineOptions.WithRuntime 使用的可变配置构建器。

Mutable builder used by EngineOptions.WithRuntime.

命名空间:AuroraScript。类型:class。

Namespace: AuroraScript. Kind: class.

返回 .NET Host API 参考

Back to .NET Host API Reference

用途

Purpose

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

Mutable builder used by EngineOptions.WithRuntime.

简单示例

Simple Example

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

A minimal use of RuntimeOptionsBuilder.

var options = EngineOptions.Default.WithRuntime(builder =>
{
    builder.HotReload = true;
    builder.StringPooling = StringPoolingStrategy.Intern;
});

成员

Members

RuntimeOptionsBuilder(RuntimeOptions options)

创建 RuntimeOptionsBuilder 实例。

Use the member according to its public signature.

Parameters:

  • options
    控制此操作的配置。

    Configuration controlling this operation.

Returns

新建的 RuntimeOptionsBuilder 实例。

A new RuntimeOptionsBuilder instance.

调用示意

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

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

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

bool HotReload

读取 HotReload 属性。

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.

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

ScriptJsonSerializer JsonSerializer

读取 JsonSerializer 属性。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 ScriptJsonSerializer

Returns ScriptJsonSerializer.

调用示意

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

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

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

string DateTimeFormat

读取 DateTimeFormat 属性。

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.

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

TextWriter ConsoleStdOut

读取 ConsoleStdOut 属性。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 TextWriter

Returns TextWriter.

调用示意

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

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

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

TextWriter ConsoleErrorOut

读取 ConsoleErrorOut 属性。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 TextWriter

Returns TextWriter.

调用示意

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

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

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

StringPoolingStrategy StringPooling

读取 StringPooling 属性。

Use the member according to its public signature.

Parameters:

  • 无。

    None.

Returns

返回 StringPoolingStrategy

Returns StringPoolingStrategy.

调用示意

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

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

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

WithMethods

签名

  • RuntimeOptionsBuilder WithHotReload(bool value)
  • RuntimeOptionsBuilder WithJsonSerializer(ScriptJsonSerializer value)
  • RuntimeOptionsBuilder WithDateTimeFormat(string value)
  • RuntimeOptionsBuilder WithConsoleStdOut(TextWriter value)
  • RuntimeOptionsBuilder WithConsoleErrorOut(TextWriter value)
  • RuntimeOptionsBuilder WithStringPooling(StringPoolingStrategy value)

调用 WithMethods 完成其公开操作。

Use the member according to its public signature.

Parameters:

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

    Value to process, store, or convert.

Returns

由公开签名定义的返回值。

The value defined by the public signature.

调用示意

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

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

RuntimeOptionsBuilder value = /* 从宿主 API 获取实例 */;
var result = value.WithMethods(/* value */);

Clone this wiki locally