Search code examples
c#windows-runtimewindows-store-appsstoragefile

Moving items to the top of the FutureAccessList


I'm using the StorageApplicationPermissions.FutureAccessList to store access tokens for files and folders in my app. When the app is first launched, a user can choose a "documents" folder where items are stored by default. Access to this folder is stored in the FutureAccessList

This list has a max of 1000 items. As I understand it, once the 1000th item is added to the list, the 1st item is dropped.

How do I move an item up to the top of the FutureAccessList so it never loses access?


Solution

  • This is indicated on the MSDN page:

    Unlike the MRU, the platform does not manage the futureAccessList for you. When you reach the 1000 item limit, you must remove an item from the list before adding another one. You can do this by using the remove method.

    Basically, items won't be removed from this list unless you do it yourself. Therefore, there's no need to move anyting at top of the list, you just need to be careful about what items you remove (if you ever need to).