Skip to main content
CachedFileUpdater.SetUpdateInformation | setUpdateInformation method

Configures update policies for a local file.

Syntax


Windows.Storage.Provider.CachedFileUpdater.setUpdateInformation(file, contentId, readMode, writeMode, options);

public static void SetUpdateInformation(
  IStorageFile file, 
  string contentId, 
  ReadActivationMode readMode, 
  WriteActivationMode writeMode, 
  CachedFileOptions options
)

Public Shared Sub SetUpdateInformation(
  file As IStorageFile,  
  contentId As String,  
  readMode As ReadActivationMode,  
  writeMode As WriteActivationMode,  
  options As CachedFileOptions 
)

public:
static void SetUpdateInformation(
  IStorageFile^ file, 
  String^ contentId, 
  ReadActivationMode readMode, 
  WriteActivationMode writeMode, 
  CachedFileOptions options
)

Parameters

file

Type: IStorageFile

The local file.

contentId

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

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

Type: ReadActivationMode

A value that specifies whether Windows will request updates before the local file is read by other apps.

writeMode

Type: 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

Type: 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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Storage.Provider
Windows::Storage::Provider [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Storage.Provider
Windows::Storage::Provider [C++]

Metadata

Windows.winmd

See also

CachedFileUpdater