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, IVectorViewpublic sealed class AccessListEntryView : IEnumerable, IReadOnlyListPublic NotInheritable Class AccessListEntryView Implements IEnumerable, IReadOnlyList// You can use this class in JavaScript.
- Attributes
| 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]
Gets the element at the specified index in the read-only list.
This member is not implemented in C++T this[int index] { get; }ReadOnly Property Item(index As Integer) As TT this[int index] { get; }
- index
The zero-based index of the element to get.
- Value
- T T T T
The element at the specified index in the read-only list.
Size Size Size Size
Gets the number of storage items in the access list or most recently used (MRU) list.
public : unsigned int Size { get; }This member is not implemented in C#This member is not implemented in VB.Net// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The number of entries.
Methods
First() First() First() First()
Retrieves the first storage item from the access list or most recently used (MRU) list.
public : IIterator<AccessListEntry> First()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
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.
public : AccessListEntry GetAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
- index
- unsigned int UInt32 UInt32 UInt32
The
zero-based index of the storage item to retrieve.
The storage item.
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()
Returns an enumerator that iterates through the collection.
This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)IEnumerator<T> GetEnumerator()
An enumerator that can be used to iterate through the collection.
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.
public : unsigned int GetMany(unsigned int startIndex, AccessListEntry[] items)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
- startIndex
- unsigned int UInt32 UInt32 UInt32
The zero-based index of the start of the items in the collection to retrieve.
- items
- AccessListEntry[] AccessListEntry[] AccessListEntry[] AccessListEntry[]
The items in the collection that start at startIndex.
The number of items retrieved.
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.
public : PlatForm::Boolean IndexOf(AccessListEntry value, unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
The storage item.
- index
- unsigned int UInt32 UInt32 UInt32
The zero-based index of the storage item.
True if the specified storage item exists in the list; otherwise false.