Show / Hide Table of Contents

Class SettingDescriptor

Abstract base class for describing a configurable engine setting. Subclasses carry type-specific properties (e.g. MinLength, MinValue, Options, Columns). Hosts use pattern matching on the concrete type to render the appropriate UI control.

Inheritance
object
SettingDescriptor
BooleanSettingDescriptor
DirectoryPathSettingDescriptor
EnumSettingDescriptor
FilePathSettingDescriptor
IntegerSettingDescriptor
PasswordSettingDescriptor
StringSettingDescriptor
TableSettingDescriptor
UrlSettingDescriptor
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public abstract class SettingDescriptor

Constructors

| Edit this page View Source

SettingDescriptor(string, LocalizedString)

Initializes a new instance of the SettingDescriptor class.

Declaration
protected SettingDescriptor(string key, LocalizedString displayName)
Parameters
Type Name Description
string key

Machine-readable key for this setting.

LocalizedString displayName

Localizable UI label.

Properties

| Edit this page View Source

Description

Gets or sets the optional localizable description (tooltip / help text).

Declaration
public LocalizedString? Description { get; init; }
Property Value
Type Description
LocalizedString
| Edit this page View Source

DisplayName

Gets the localizable display name shown as the field label in the UI.

Declaration
public LocalizedString DisplayName { get; }
Property Value
Type Description
LocalizedString
| Edit this page View Source

IconSvg

Gets or sets optional SVG markup for compact UI (e.g. table column headers). When set, hosts may render the icon and use DisplayName as a tooltip.

Declaration
public string? IconSvg { get; init; }
Property Value
Type Description
string
| Edit this page View Source

IsRequired

Gets or sets a predicate that determines whether this setting must be filled before the engine can be initialized, based on the current values of all settings. Defaults to not required.

Declaration
public Func<IReadOnlyDictionary<string, object?>, bool> IsRequired { get; init; }
Property Value
Type Description
Func<IReadOnlyDictionary<string, object>, bool>
Remarks

Same contract as IsVisible: the host passes current values (keys may be absent), and re-evaluates on every change. Hosts evaluate this predicate only for settings whose IsVisible returned true. Example: IsRequired = s => s.GetValueOrDefault("source") as string == "directory"; unconditional: IsRequired = static _ => true.

| Edit this page View Source

IsVisible

Gets or sets a predicate that determines whether this setting is currently relevant, based on the current values of all settings (keyed by Key). Defaults to always visible.

Declaration
public Func<IReadOnlyDictionary<string, object?>, bool> IsVisible { get; init; }
Property Value
Type Description
Func<IReadOnlyDictionary<string, object>, bool>
Remarks

The host invokes the predicate with the dictionary of current setting values; keys may be absent when a setting has not been set — the predicate should fall back to the default value. Hosts should re-evaluate the predicate whenever any setting value changes, hide the field when it returns false, and skip IsRequired validation for hidden settings. Example: IsVisible = s => s.GetValueOrDefault("source") as string == "url".

| Edit this page View Source

Key

Gets the machine-readable key for this setting (e.g. "source", "directoryPath").

Declaration
public string Key { get; }
Property Value
Type Description
string
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX