In This Article

RecentDocumentManager Class

Provides a manager for a recent documents list.

public class RecentDocumentManager : DependencyObject
Inheritance:
object object

Remarks

For detailed documentation on this component's features and how to use them, please see the Shared Document Management documentation topic.

Constructors

RecentDocumentManager()

Initializes an instance of the RecentDocumentManager class.

public RecentDocumentManager()

Properties

Documents

Gets the collection of IDocumentReference objects that are being managed.

public DocumentReferenceCollection Documents { get; }

Property Value

DocumentReferenceCollection:

The collection of IDocumentReference objects that are being managed.

Remarks

Add/remove the document references to be managed via this collection. The FilteredDocuments provides a sorted read-only representation of this collection.

FilteredDocuments

Gets the read-only collection of filtered documents that should be used for a recent documents list.

public ReadOnlyDocumentReferenceCollection FilteredDocuments { get; }

Property Value

ReadOnlyDocumentReferenceCollection:

The read-only collection of filtered documents that should be used for a recent documents list.

Remarks

The collection sorts the contained documents by date/time and pinned states and returns up to MaxFilteredDocumentCount documents.

MaxDocumentCount

Gets or sets the maximum number of documents to store in the Documents collection.

public int MaxDocumentCount { get; set; }

Property Value

int:

The maximum number of documents to store in the Documents collection. The default value is 30.

Remarks

This collection is how many documents total are being tracked.

MaxFilteredDocumentCount

Gets or sets the maximum number of documents to return in the FilteredDocuments collection.

public int MaxFilteredDocumentCount { get; set; }

Property Value

int:

The maximum number of documents to return in the FilteredDocuments collection. The default value is 16.

Methods

Deserialize(string)

Deserializes the Documents collection from the data in an XML string.

public void Deserialize(string xml)
Parameter Type Description
xml string

The XML string containing data.

Remarks

The XML string must have been created by a previous call to Serialize().

GetDocumentReference(Uri)

Returns an existing IDocumentReference from the Documents collection, if any, that matches the specified System.Uri.

public IDocumentReference GetDocumentReference(Uri location)
Parameter Type Description
location Uri

The System.Uri to search for.

Returns

IDocumentReference:

A IDocumentReference that is in the Documents collection if a match is found; otherwise, null.

GetIndex(DependencyObject)

Gets the value of the Index attached property for the specified object.

public static int GetIndex(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

int:

The object's value.

NotifyDocumentOpened(Uri)

Provides a helper method for easily updating an existing document reference's last-opened date/time. If no existing document reference with the specified System.Uri exists, a new DocumentReference is created.

public IDocumentReference NotifyDocumentOpened(Uri location)
Parameter Type Description
location Uri

A System.Uri indicating the location of the document.

Returns

IDocumentReference:

The IDocumentReference that was updated or created.

NotifyDocumentOpened(Uri, string)

Provides a helper method for easily updating an existing document reference's last-opened date/time. If no existing document reference with the specified System.Uri exists, a new DocumentReference is created.

public IDocumentReference NotifyDocumentOpened(Uri location, string name)
Parameter Type Description
location Uri

A System.Uri indicating the location of the document.

name string

The name of the document.

Returns

IDocumentReference:

The IDocumentReference that was updated or created.

NotifyDocumentOpened(Uri, string, object)

Provides a helper method for easily updating an existing document reference's last-opened date/time. If no existing document reference with the specified System.Uri exists, a new DocumentReference is created.

public IDocumentReference NotifyDocumentOpened(Uri location, string name, object tag)
Parameter Type Description
location Uri

A System.Uri indicating the location of the document.

name string

The name of the document.

tag object

An arbitrary object value that can be used to store custom information about this document reference.

Returns

IDocumentReference:

The IDocumentReference that was updated or created.

RebindFilteredDocuments()

Rebinds the FilteredDocuments collection.

public void RebindFilteredDocuments()

Remarks

The FilteredDocuments collection is automatically re-bound when the Documents collection is changed. However if you update the last-opened date/time or pinned flag for an IDocumentReference, you must call this method manually to rebind the FilteredDocuments collection.

Serialize()

Serializes the Documents collection to an XML string.

public string Serialize()

Returns

string:

The XML string that contains the serialized data.

Remarks

Use the Deserialize(string) method to load the serialized data later.

SetIndex(DependencyObject, int)

Sets the value of the Index attached property to the specified object.

public static void SetIndex(DependencyObject obj, int value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value int

The value to set.

Fields

IndexProperty

Identifies the Index dependency property. This field is read-only.

public static readonly DependencyProperty IndexProperty

MaxDocumentCountProperty

Identifies the MaxDocumentCount dependency property. This field is read-only.

public static readonly DependencyProperty MaxDocumentCountProperty

MaxFilteredDocumentCountProperty

Identifies the MaxFilteredDocumentCount dependency property. This field is read-only.

public static readonly DependencyProperty MaxFilteredDocumentCountProperty