IDataFile Pennington.Data
Non-generic facade over a single registered data file. Used by DataFiles to enumerate every DataFileEntry the container has registered without reflecting over the closed generic types. Reloads through IFileWatchAware.
Properties
Namestring- Logical name supplied at registration; lookup key for
Get. ValueTypeType- The closed generic type the entry was registered with.
Inherited from IFileWatchAware
WatchScopesIReadOnlyList<FileWatchScope>- Directories needing an OS-level watcher. Empty (the default) for aggregators that ride notifications other watchers already produce.
Methods
GetValue
#public object GetValue()
Returns the current loaded value, refreshed if the underlying file has changed since last access.
Returns
objectInherited from IFileWatchAware
OnFileChanged
#public FileWatchResponse OnFileChanged(FileChangeNotification change)
Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
Parameters
changeFileChangeNotification
Returns
FileWatchResponsePennington.Data.IDataFile
namespace Pennington.Data;
/// Non-generic facade over a single registered data file. Used by DataFiles to enumerate every DataFileEntry the container has registered without reflecting over the closed generic types. Reloads through IFileWatchAware.
public interface IDataFile
{
/// 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; }
}