SharedState class
Thread‑safe, case‑insensitive global key/value store for reference‑type objects.
public class SharedState
Public Members
| name | description |
|---|---|
| SharedState(…) | Initializes a new instance of the SharedState class. |
| Count { get; } | Gets the number of key/value pairs in the shared state. |
| Keys { get; } | Gets an enumerable collection of all keys in the shared state. |
| Values { get; } | Gets an enumerable collection of all values in the shared state. |
| Clear() | Clears all entries in the shared state. |
| Contains(…) | Checks if a variable with the specified name exists in the shared state. |
| Get(…) | Untyped fetch; null if absent. |
| KeySnapshot() | Snapshot of keys only—handy for quick listings. |
| Remove(…) | Attempts to remove the value with the specified name from the shared state. |
| Set(…) | Add or overwrite a value (reference‑types only). |
| Snapshot() | Snapshot of all current variables (shallow copy). |
| TryGet<T>(…) | Strongly‑typed fetch. Returns false if the key is missing or the stored value can’t be cast to T. |
See Also
- namespace Kestrun.SharedState
- SharedState.cs