IniDuplicateSectionBehavior Enum
Definition
- Namespace
- Bodu.Text.Configuration
- Assembly
- Bodu.Text.Configuration.dll
- Package
- Bodu.Text.Configuration 1.0.0
Defines how the configuration parser resolves a section name that appears more than once in the source.
public enum IniDuplicateSectionBehavior
- Extension Methods
Fields
Merge = 0Entries from later occurrences of a section are merged into the first occurrence. The active DuplicateKeyPolicy governs any key conflicts introduced by the merge.
Disallowed = 1Duplicate section names are not permitted. A duplicate section header is rejected, surfacing as a ConfigurationParseException or a collected diagnostic depending on the active ConfigurationDiagnosticMode.
Preserve = 2Retain duplicate sections as separate entries in source order so that downstream consumers can apply their own precedence rules (for example, EditorConfig's last-section-wins).
MergeAdjacent = 3Merge a duplicate section into the immediately preceding section only when the two share the same name and no other section appears between them; otherwise, retain the section as a separate occurrence.
MergeAll = 0Explicit alias for Merge: merge every duplicate occurrence into the first regardless of position. Provided so callers selecting from a finer-grained set of behaviours can opt in by name.
Remarks
The Merge value (the default) preserves the historical INI behaviour: entries from later occurrences are merged into the first occurrence. MergeAll is an explicit alias for this value. MergeAdjacent and Preserve implement the finer-grained EditorConfig-style semantics the configuration profiles require.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |