Class IntentCatalogSnapshot
- Namespace
- IntentSharp.Catalog
- Assembly
- IntentSharp.Catalog.dll
A view of the catalog at one moment: a fixed set of definitions, replaced atomically on reload and never changed in place, so callers that hold a snapshot see consistent definitions. The IntentDefinition objects are the catalog's own, not copies; treat them as read-only. IntentRuntime runs a checked private copy of each, so changing one in place after it has run changes nothing (use Describe(string) for a copy to edit).
public sealed class IntentCatalogSnapshot
- Inheritance
-
objectIntentCatalogSnapshot
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Constructors
- IntentCatalogSnapshot(long, IReadOnlyDictionary<string, IntentDefinition>, IReadOnlyList<CatalogProblem>, DateTimeOffset)
Creates a snapshot from the given values, as they are; nothing is copied or checked. Custom catalogs call this to publish.
Properties
- Definitions
Definitions by name, in the dictionary the snapshot was created with. The built-in catalogs use one that ignores case.
- Empty
A snapshot with no definitions and no problems, at generation 0. Catalogs return it before their first load.
- Generation
Increases with every new snapshot, whether or not its load reported problems. A higher generation does not mean an edit took effect; check Problems for that.
- Problems
Problems from the most recent load attempt (empty when it was clean).
Methods
- TryGet(string, out IntentDefinition)
Finds the definition named
namein Definitions. Returns false, withdefinitionnull, when there is none. The name is not trimmed.