FileUpdateRequestDeferral class

Applies to Windows and Windows Phone

Use to complete an update asynchronously.

Syntax


var fileUpdateRequestDeferral = fileUpdateRequest.getDeferral();

Attributes

[Version(0x06020000)]

Members

The FileUpdateRequestDeferral class has these types of members:

Methods

The FileUpdateRequestDeferral class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
Complete Signals that the response to a FileUpdateRequested event is finished.

 

Remarks

If your app participates in the Cached File Updater contract, and you can't finish responding to the update before returning from your FileUpdateRequested event handler, call the FileUpdaterRequestDeferral.Complete method to complete the update asynchronously.

If the app

Note  The file picker UI is disabled until the app has finished responding to all FileUpdateRequested events that were fired.

To learn about responding to a FileUpdateRequested event, see FileUpdateRequestedEventArgs.

Examples

The File picker contracts sample demonstrates how to respond to a FileUpdateRequested event, including how to get a deferral.



// Event handler
function onFileUpdateRequest(e) {
    fileUpdateRequest = e.request;
    fileUpdateRequestDeferral = fileUpdateRequest.getDeferral();

    switch (cachedFileUpdaterUI.uiStatus) {
        case Windows.Storage.Provider.UIStatus.hidden:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.userInputNeeded;
            fileUpdateRequestDeferral.complete();
            break;
        case Windows.Storage.Provider.UIStatus.visible:
            var url = scenarios[0].url;
            WinJS.Navigation.navigate(url, cachedFileUpdaterUI);
            break;
        case Windows.Storage.Provider.UIStatus.unavailable:
            fileUpdateRequest.status = Windows.Storage.Provider.FileUpdateStatus.failed;
            fileUpdateRequestDeferral.complete();
            break;
    }
}

// Register for the event
cachedFileUpdaterUI.addEventListener("fileupdaterequested", onFileUpdateRequest);

Both args and e (in C# and JS respectively) contain a FileUpdateRequestedEventArgs object.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft