AccessListEntryView AccessListEntryView AccessListEntryView AccessListEntryView AccessListEntryView Class

Definition

A list of the entries that are in your app's most recently used list (MRU) (obtained from the static StorageApplicationPermissions.MostRecentlyUsedList property) and in your app's future-access list (obtained from the static StorageApplicationPermissions.FutureAccessList property).

public : sealed class AccessListEntryView : IIterable<AccessListEntry>, IVectorView<AccessListEntry>
struct winrt::Windows::Storage::AccessCache::AccessListEntryView : IIterable<AccessListEntry>, IVectorView<AccessListEntry>
public sealed class AccessListEntryView : IEnumerable<AccessListEntry>, IReadOnlyList<AccessListEntry>
Public NotInheritable Class AccessListEntryView Implements IEnumerable<AccessListEntry>, IReadOnlyList<AccessListEntry>
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The File access sample demonstrates how to enumerate entries in the MostRecentlyUsedList.

AccessListEntryView entries = StorageApplicationPermissions.MostRecentlyUsedList.Entries;
if (entries.Count > 0)
{
    foreach (AccessListEntry entry in entries)
    {
        StringBuilder outputText = new StringBuilder("The MRU list contains the following item(s):" + Environment.NewLine + Environment.NewLine);
        outputText.AppendLine(entry.Metadata);
    }
}
else
{
    // Handle empty list
}
var entries = Windows.Storage.AccessCache.StorageApplicationPermissions.mostRecentlyUsedList.entries;
if (entries.size > 0) {
    var outputText = "The MRU list contains the following item(s):<br/><br/>";
    mruEntries.forEach(function (entry) {
        mruOutputText += entry.metadata + "<br/>"; // Application previously chose to store sampleFile.name in this field
    });
} else {
    // Handle empty list
}

Remarks

To see more code examples that use this class, see the File access sample.

Collection member lists

For JavaScript, AccessListEntryView has the members shown in the member lists. In addition, AccessListEntryView supports a length property, members of Array.prototype, and using an index to access items.

Enumerating the collection in C# or Microsoft Visual Basic

AccessListEntryView is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<AccessListEntry> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with an AccessListEntry constraint.

Properties

Item[Int32] Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets the element at the specified index in the read-only list.

Size Size Size Size Size

Gets the number of storage items in the access list or most recently used (MRU) list.

Methods

First() First() First() First() First()

Retrieves the first storage item from the access list or most recently used (MRU) list.

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Retrieves the storage item at the specified index in the access list or most recently used (MRU) list.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, AccessListEntry[]) GetMany(UInt32, AccessListEntry[]) GetMany(UInt32, AccessListEntry[]) GetMany(UInt32, AccessListEntry[]) GetMany(UInt32, AccessListEntry[])

Retrieves the storage items that start at the specified index in the access list or most recently used (MRU) list.

IndexOf(AccessListEntry, UInt32) IndexOf(AccessListEntry, UInt32) IndexOf(AccessListEntry, UInt32) IndexOf(AccessListEntry, UInt32) IndexOf(AccessListEntry, UInt32)

Retrieves the index of the specified storage item in the access list or most recently used (MRU) list.

See Also