This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy at the same URL with .md appended. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

DataFileEntry Pennington.Data

Singleton holder for a single registered data file. The first call to GetValue loads and deserializes the file via DataFileLoader; subsequent calls return the cached value until FileWatchDispatcher reports the file has changed, at which point the next access reloads it.

Properties

Name string
Logical name supplied at registration; lookup key for Get.
ValueType Type
The closed generic type the entry was registered with.
WatchScopes IReadOnlyList<FileWatchScope>
Directories needing an OS-level watcher. Empty (the default) for aggregators that ride notifications other watchers already produce.

Constructors

DataFileEntry

#
public DataFileEntry`1(string name, string path, IFileSystem fileSystem)

Creates the entry; the file itself is not read until GetValue is called.

Parameters

name string
Logical name; the lookup key for Get.
path string
Path to the data file. Resolved against the current working directory if relative.
fileSystem IFileSystem
Abstraction used to read the file.

Methods

GetValue

#
public object GetValue()

Returns the current loaded value, refreshed if the underlying file has changed since last access.

Returns

object

OnFileChanged

#
public FileWatchResponse OnFileChanged(FileChangeNotification change)

Called on the file-watcher thread for every watched change. Must be quick and thread-safe.

Parameters

change FileChangeNotification

Returns

FileWatchResponse

Pennington.Data.DataFileEntry

namespace Pennington.Data;

/// Singleton holder for a single registered data file. The first call to GetValue loads and deserializes the file via DataFileLoader; subsequent calls return the cached value until FileWatchDispatcher reports the file has changed, at which point the next access reloads it.
public class DataFileEntry
{
    /// Creates the entry; the file itself is not read until GetValue is called.
    
public DataFileEntry`1(string name, string path, IFileSystem fileSystem)
; /// Returns the current loaded value, refreshed if the underlying file has changed since last access.
public object GetValue()
; /// Logical name supplied at registration; lookup key for Get.
public string Name { get; }
/// Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
; /// The closed generic type the entry was registered with.
public Type ValueType { get; }
/// Directories needing an OS-level watcher. Empty (the default) for aggregators that ride notifications other watchers already produce.
public IReadOnlyList<FileWatchScope> WatchScopes { get; }
}