Class SettingDescriptor
- Namespace
- IntentSharp.Guardrails
- Assembly
- IntentSharp.dll
Declares a setting: its name, the values it takes, and what it resolves to when nothing sets it. A setting resolves to a file's value, else the code value, else, for an ordinary setting, LibraryDefault and, for a security setting, FailClosedValue; there is no ceiling and no comparison between the layers. The library declares the core settings; add your own with AddSetting(SettingDescriptor) or Settings.
public sealed class SettingDescriptor
- Inheritance
-
objectSettingDescriptor
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Remarks
A file removes a Count or Duration limit only by writing the
text "unlimited" (exactly, case-sensitive), and only where AllowsUnlimited is true; the code
layer uses the same text. Zero is a literal where AllowsZero is true and refused where it is false; a
negative value is always refused. Zero never means "no limit". A refused value is reported and the setting falls
back to the next layer.
Constructors
Properties
- AllowedValues
For a Text setting, the only values it takes, compared ordinally; null takes any text.
- AllowsUnlimited
True when
"unlimited"removes this setting's limit; false when it is refused.
- AllowsZero
True when zero is a literal value for this setting; false when zero is refused.
- Description
What the setting controls, for people and for the model that edits settings files.
- FailClosedValue
What a security setting resolves to when nothing sets it. Required when Security is true.
- Kind
The kind of value the setting takes.
- LibraryDefault
What an ordinary setting resolves to when no file and no code sets it; null for no value. Not used for a security setting.
- Name
The setting's name, such as
"data.timeout"; compared ordinally.
- Security
True for a setting that guards access or bounds what an operation may do: when no file and no code sets it, it resolves to FailClosedValue, never to a permissive default. When several named rule sets set it, the narrowest value applies: the smaller number or time (
"unlimited"is the widest), false, or for a text setting its fail-closed value when one of them gives it.