ข้ามไปยังเนื้อหา

Class EngineOptions

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.Engine.Configuration
Assembly: Cephalon.Engine.dll

Captures module and capability enablement overrides for the runtime.

public sealed class EngineOptions

objectEngineOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

EngineOptions(IReadOnlyDictionary<string, bool>?, IReadOnlyDictionary<string, bool>?)

Section titled “ EngineOptions(IReadOnlyDictionary<string, bool>?, IReadOnlyDictionary<string, bool>?)”

Initializes a new instance of the class.

public EngineOptions(IReadOnlyDictionary<string, bool>? modules = null, IReadOnlyDictionary<string, bool>? capabilities = null)

modules IReadOnlyDictionary<string, bool>?

Module enablement overrides keyed by module identifier.

capabilities IReadOnlyDictionary<string, bool>?

Capability enablement overrides keyed by capability key.

Gets capability enablement overrides keyed by capability key.

public IReadOnlyDictionary<string, bool> Capabilities { get; }

IReadOnlyDictionary<string, bool>

Gets an empty options instance with no explicit overrides.

public static EngineOptions Empty { get; }

EngineOptions

Gets a value indicating whether any explicit option overrides are present.

public bool HasValues { get; }

bool

Gets module enablement overrides keyed by module identifier.

public IReadOnlyDictionary<string, bool> Modules { get; }

IReadOnlyDictionary<string, bool>

FromConfiguration(IConfiguration, string)

Section titled “ FromConfiguration(IConfiguration, string)”

Reads engine options from configuration.

public static EngineOptions FromConfiguration(IConfiguration configuration, string sectionPath = "Engine")

configuration IConfiguration

The configuration source that contains the engine section.

sectionPath string

The root configuration section path to read from.

EngineOptions

The parsed engine options.

Determines whether a capability is enabled under the current option set.

public bool IsCapabilityEnabled(string capabilityKey)

capabilityKey string

The capability key to evaluate.

bool

true when the capability is enabled; otherwise, false.

Determines whether a module is enabled under the current option set.

public bool IsModuleEnabled(string moduleId)

moduleId string

The module identifier to evaluate.

bool

true when the module is enabled; otherwise, false.

Merges another option set into the current instance.

public EngineOptions Merge(EngineOptions? other)

other EngineOptions?

The option set to overlay on top of the current values.

EngineOptions

A merged option set.