Table of Contents

Class PpkOnDriveDevCodeBase<T>

Namespace
SunamoDevCode
Assembly
SunamoDevCode.dll

Abstract base class for persistent collections stored on drive, with file watching and auto-save capabilities.

public abstract class PpkOnDriveDevCodeBase<T> : List<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable

Type Parameters

T

Type of elements in the collection.

Inheritance
List<T>
PpkOnDriveDevCodeBase<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

PpkOnDriveDevCodeBase(PpkOnDriveDevCodeArgs)

Initializes the persistent collection with the specified arguments, creating the file if needed and optionally watching for changes.

public PpkOnDriveDevCodeBase(PpkOnDriveDevCodeArgs args)

Parameters

args PpkOnDriveDevCodeArgs

Configuration arguments for persistence behavior.

Fields

args

Configuration arguments for persistence behavior.

protected PpkOnDriveDevCodeArgs args

Field Value

PpkOnDriveDevCodeArgs

Methods

Add(IList<T>)

Adds multiple items to the collection, saving after each addition.

public Task Add(IList<T> items)

Parameters

items IList<T>

Items to add.

Returns

Task

Add(T)

Adds an item if not already present and the value is non-empty, then saves to disk.

public Task<bool> Add(T value)

Parameters

value T

Item to add.

Returns

Task<bool>

True if the item was actually added.

AddWithoutSave(T)

Adds an item to the collection without triggering a save to disk.

public void AddWithoutSave(T value)

Parameters

value T

Item to add.

Clear()

Clears all items and saves the empty collection to disk.

public Task Clear()

Returns

Task

Load()

Loads the collection contents from the backing file on disk.

public abstract Task Load()

Returns

Task

Remove(T)

Removes the specified item and saves the collection to disk.

public Task Remove(T value)

Parameters

value T

Item to remove.

Returns

Task

RemoveAll()

Removes all items from the collection and clears the backing file.

public Task RemoveAll()

Returns

Task

Save()

Persists the current collection contents to the backing file on disk.

public Task Save()

Returns

Task

ToString()

Returns all items as a newline-separated string.

public override string ToString()

Returns

string

String representation of all items.