Interface IMruManager
Interface that describes an API that manages a MRU (Most Recently Used files) table which is stored in the AppSettings file.
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Wpf.dll
Syntax
public interface IMruManager : IViewModel, IProgressReporter, IViewModelCommon, INotifyDataErrorInfo, IProgressReporterCommon, INotifyPropertyChanged
Properties
| Improve this Doc View SourceMaxMostRecentlyUsedCount
The maximum number of files that are kept in the MRU table.
The default value is 10.
Declaration
int MaxMostRecentlyUsedCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Remarks
When the limit is exceeded, the least recent used file will be removed from the MRU table every time a new file is added.
The maximum allowed value is 100. The minimum allowed value is 1.
MostRecentlyUsedFile
Gets the MRU file which is the last file added to the MRU table.
Declaration
MostRecentlyUsedFileItem MostRecentlyUsedFile { get; }
Property Value
| Type | Description |
|---|---|
| MostRecentlyUsedFileItem |
MostRecentlyUsedFiles
A ReadOnlyObservableCollection<T> collection of MostRecentlyUsedFileItem which contains the MRU files.
Declaration
ReadOnlyObservableCollection<MostRecentlyUsedFileItem> MostRecentlyUsedFiles { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyObservableCollection<MostRecentlyUsedFileItem> |
Methods
| Improve this Doc View SourceAddMostRecentlyUsedFile(String)
Adds a file with the specified path to the MRU table.
Declaration
void AddMostRecentlyUsedFile(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filePath | The path to the file which is to add to the MRU table. |
Remarks
Checks if the file exists. Does nothing if file doesn't exist. When the number of files in the MRU table exceeds the limit set by MaxMostRecentlyUsedCount the entry with the least recent access is removed from the table.
Clear()
Clears the MRU list.
Declaration
void Clear()
Events
| Improve this Doc View SourceFileAdded
Raised when a new file was added to the MRU list. The event args contains the old and the new MostRecentlyUsedFileItem.
Once the max MostRecentlyUsedFileItem limit is reached, the least used file will be removed from the list to make space for the new item.
In this case the OldValue is the removed oldest item in the list.
Otherwise OldValue will be null.
Declaration
event EventHandler<ValueChangedEventArgs<MostRecentlyUsedFileItem>> FileAdded
Event Type
| Type | Description |
|---|---|
| EventHandler<ValueChangedEventArgs<MostRecentlyUsedFileItem>> |