PromptPlus

PromptPlus

PromptPlus

PromptPlusLibrary

IHistory Interface

Provides a fluent API for adding, reading, and managing persisted history entries.

public interface IHistory

Methods

IHistory.AddHistory(string, Nullable<TimeSpan>) Method

Adds an entry to history.

PromptPlusLibrary.IHistory AddHistory(string value, System.Nullable<System.TimeSpan> timeout=null);

Parameters

value System.String

The value to store in history.

timeout System.Nullable<System.TimeSpan>

Optional lifetime for the entry. After the timeout expires, the entry may be removed depending on the implementation. If null, no expiration is applied.

Returns

IHistory
The current IHistory instance for fluent chaining.

IHistory.ReadHistory<T>() Method

Reads all history entries and deserializes them to the specified type.

System.Collections.Generic.IList<T> ReadHistory<T>();

Type parameters

T

The type used to deserialize history entries.

Returns

System.Collections.Generic.IList<T>
A list of deserialized history entries.

IHistory.Remove() Method

Removes persisted history, such as deleting the backing store or clearing all entries.

void Remove();

IHistory.Save() Method

Persists in-memory history entries to durable storage.

void Save();