Class DateTimeFileIndexT<StorageFolder, StorageFile>
- Namespace
- SunamoShared.Storage
- Assembly
- SunamoShared.dll
Manages a date-time based file index for organizing and retrieving stored files.
public class DateTimeFileIndexT<StorageFolder, StorageFile>
Type Parameters
StorageFolderThe type representing a storage folder.
StorageFileThe type representing a storage file.
- Inheritance
-
DateTimeFileIndexT<StorageFolder, StorageFile>
- Inherited Members
- Extension Methods
Constructors
DateTimeFileIndexT()
Initializes a new empty instance of the file index.
public DateTimeFileIndexT()
Properties
Catalog
The abstract catalog used for storage operations.
public AbstractCatalogShared<StorageFolder, StorageFile> Catalog { get; set; }
Property Value
- AbstractCatalogShared<StorageFolder, StorageFile>
Files
The list of file entries with associated date-time metadata.
public List<FileNameWithDateTimeTU<StorageFolder, StorageFile>> Files { get; set; }
Property Value
- List<FileNameWithDateTimeTU<StorageFolder, StorageFile>>
Methods
CreateObjectFileNameWithDateTime(string, string, AbstractCatalogShared<StorageFolder, StorageFile>)
Creates a file entry object from display rows and the current catalog.
public FileNameWithDateTimeTU<StorageFolder, StorageFile> CreateObjectFileNameWithDateTime(string row1, string row2, AbstractCatalogShared<StorageFolder, StorageFile> catalog)
Parameters
row1stringThe first display row text.
row2stringThe second display row text.
catalogAbstractCatalogShared<StorageFolder, StorageFile>The abstract catalog for storage operations.
Returns
- FileNameWithDateTimeTU<StorageFolder, StorageFile>
A new file entry with parsed date-time and metadata.
DeleteFile(FileNameWithDateTimeTU<StorageFolder, StorageFile>)
Deletes the specified file entry from storage and removes it from the file list.
public void DeleteFile(FileNameWithDateTimeTU<StorageFolder, StorageFile> fileEntry)
Parameters
fileEntryFileNameWithDateTimeTU<StorageFolder, StorageFile>The file entry to delete.
GetFullPath(FileNameWithDateTimeTU<StorageFolder, StorageFile>)
Returns the full path of the specified file entry.
public string GetFullPath(FileNameWithDateTimeTU<StorageFolder, StorageFile> fileEntry)
Parameters
fileEntryFileNameWithDateTimeTU<StorageFolder, StorageFile>The file entry to resolve.
Returns
- string
The full path string, or null if not resolved.
GetStorageFile(FileNameWithDateTimeTU<StorageFolder, StorageFile>)
Gets the storage file path for the specified file entry.
public string GetStorageFile(FileNameWithDateTimeTU<StorageFolder, StorageFile> fileEntry)
Parameters
fileEntryFileNameWithDateTimeTU<StorageFolder, StorageFile>The file entry to resolve.
Returns
- string
The storage file path, or null if not resolved.
Initialize(string, FileEntriesDuplicitiesStrategy, AbstractCatalogShared<StorageFolder, StorageFile>)
Initializes the file index with the given extension, duplicity strategy, and catalog. A4 was nowhere used, deleted
public void Initialize(string ext, FileEntriesDuplicitiesStrategy ds, AbstractCatalogShared<StorageFolder, StorageFile> catalog)
Parameters
extstringThe file extension to filter by.
dsFileEntriesDuplicitiesStrategyThe duplicity strategy for file entries.
catalogAbstractCatalogShared<StorageFolder, StorageFile>The abstract catalog for storage operations.
SaveFileWithDate(string, string)
Saves a file with a date-time based name using the duplicity strategy specified during initialization. Does not add to the files collection directly; returns the created entry.
public Task<FileNameWithDateTimeTU<StorageFolder, StorageFile>> SaveFileWithDate(string name, string content)
Parameters
Returns
- Task<FileNameWithDateTimeTU<StorageFolder, StorageFile>>
The created file entry with date-time metadata.
Events
InitComplete
Raised when initialization of the file list is complete.
public event Action<List<FileNameWithDateTimeTU<StorageFolder, StorageFile>>>? InitComplete
Event Type
- Action<List<FileNameWithDateTimeTU<StorageFolder, StorageFile>>>