Udostępnij za pośrednictwem


CachedFileUpdater.SetUpdateInformation Method

Definition

Configures update policies for a local file.

public:
 static void SetUpdateInformation(IStorageFile ^ file, Platform::String ^ contentId, ReadActivationMode readMode, WriteActivationMode writeMode, CachedFileOptions options);
 static void SetUpdateInformation(IStorageFile const& file, winrt::hstring const& contentId, ReadActivationMode const& readMode, WriteActivationMode const& writeMode, CachedFileOptions const& options);
public static void SetUpdateInformation(IStorageFile file, string contentId, ReadActivationMode readMode, WriteActivationMode writeMode, CachedFileOptions options);
function setUpdateInformation(file, contentId, readMode, writeMode, options)
Public Shared Sub SetUpdateInformation (file As IStorageFile, contentId As String, readMode As ReadActivationMode, writeMode As WriteActivationMode, options As CachedFileOptions)

Parameters

file
IStorageFile

The local file.

contentId
String

Platform::String

winrt::hstring

A unique identifier for the local file.

You can use this identifier to associate a file in your app's repository with the local file. When updates are requested by Windows, you can use this contentId to identify the correct file in your app's repository.

readMode
ReadActivationMode

A value that specifies whether Windows will request updates before the local file is retrieved from an app's MostRecentlyUsedList or FutureAccessList.

writeMode
WriteActivationMode

A value that specifies whether other apps can write to the local file and, if so, whether Windows will request updates after the local file is written.

options
CachedFileOptions

A value that specifies additional circumstances and behaviors for when Windows requests updates.

For example, you could require Windows to request an update every time the local file is accessed by using CachedFileOptions.RequireUpdateOnAccess. For more information about possible options, see CachedFileOptions.

Remarks

In order to use this method your app must participate in the Cached File Updater contract.

You can use this method to control how other apps can access a file that is provided by your app and to control when Windows requests updates for that file.

Applies to