Actipro WPF Shared Library
Document Management
The ActiproSoftware.Windows.DocumentManagement namespace contains several classes that can be used for storing document references and maintaining recent document lists.
The RecentDocumentMenu ribbon control using the RecentDocumentManager class
These classes are used in our
Ribbon
product to manage recent documents within the ribbon application menu's optional RecentDocumentMenu control.
Document References
The IDocumentReference interface provides the base requirements for a document reference. A document reference is simply a reference to a document that contains the Uri to the document, along with the document's display name, the DateTime that it was last opened, and whether it is a pinned recent document.
The DocumentReference class is a simple implementation of the IDocumentReference class.
Recent Document Management
The RecentDocumentManager is a class that can manage a list of document references that point to recently-opened documents.
The manager class filters down the contained document references from its Documents collection into its FilteredDocuments collection.
The filtered collection will contain up to a maximum number of document references that you specify.
That collection will also be sorted in reverse date/time of the last time the document was opened,
by examining the IDocumentReference.LastOpenedDateTime property.
Further logic is applied so that if the document reference's IsPinnedRecentDocument property is true,
it will have higher priority for staying on the list and not being filtered out,
even if another more recently-opened document reference would normally cause it to be filtered out.
The recent document list managed by a RecentDocumentManager can be easily persisted to an XML string.
This XML string in turn can be saved to a settings file or database or whatever other sort of storage mechanism you use for keeping user data.
|