Class CacheState
- Namespace
- SharpConsoleUI.Core
- Assembly
- SharpConsoleUI.dll
Thread-safe cache state manager for controls. Tracks validation state, rendering status, and invalidation reasons.
public class CacheState
- Inheritance
-
CacheState
- Inherited Members
Properties
IsRendering
Gets whether a render operation is currently in progress.
public bool IsRendering { get; }
Property Value
IsValid
Gets whether the cache is currently valid.
public bool IsValid { get; }
Property Value
Methods
Dispose()
Disposes the internal reader-writer lock.
public void Dispose()
GetInvalidationReason()
Gets the current invalidation reason flags.
public InvalidationReason GetInvalidationReason()
Returns
- InvalidationReason
The combined invalidation reasons.
Invalidate(InvalidationReason)
Marks the cache as invalid with the specified reason.
public void Invalidate(InvalidationReason reason)
Parameters
reasonInvalidationReasonThe reason for invalidation.
MarkAsRendering()
Marks the cache as currently rendering to prevent concurrent render operations.
public void MarkAsRendering()
MarkAsValid()
Marks the cache as valid and clears the rendering flag and invalidation reason.
public void MarkAsValid()
TryBeginRendering()
Attempts to begin a render operation. Returns false if another render is in progress.
public bool TryBeginRendering()
Returns
- bool
trueif rendering was started;falseif a render is already in progress.