forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a23e4d
commit 1673873
Showing
13 changed files
with
156 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation; | ||
using Windows.Storage.Provider; | ||
|
||
namespace Windows.Storage | ||
{ | ||
/// <summary> | ||
/// Lets apps manage real-time updates to files. | ||
/// </summary> | ||
public static partial class CachedFileManager | ||
{ | ||
/// <summary> | ||
/// Lets apps defer real-time updates for a specified file. | ||
/// </summary> | ||
/// <param name="file">The file to defer updates for.</param> | ||
/// <remarks> | ||
/// In case of Uno Platform, this method currently | ||
/// does not have any impact. | ||
/// </remarks> | ||
public static void DeferUpdates(IStorageFile file) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initiates updates for the specified file. This method contacts the app that provided the file to perform the updates. | ||
/// </summary> | ||
/// <param name="file">The file to update.</param> | ||
/// <returns> | ||
/// When this method completes, it returns a FileUpdateStatus | ||
/// enum value that describes the status of the updates to the file. | ||
/// </returns> | ||
/// <remarks> | ||
/// On most Uno Platform targets, this method immediately returns | ||
/// success, as the file is already updated. In case of WASM using | ||
/// the download file picker, this triggers the download file dialog. | ||
/// </remarks> | ||
public static IAsyncOperation<FileUpdateStatus> CompleteUpdatesAsync(IStorageFile file) => | ||
AsyncOperation.FromTask(ct => CompleteUpdatesTaskAsync(file, ct)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#if !__WASM__ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Windows.Storage.Provider; | ||
|
||
namespace Windows.Storage | ||
{ | ||
public static partial class CachedFileManager | ||
{ | ||
private static Task<FileUpdateStatus> CompleteUpdatesTaskAsync(IStorageFile file, CancellationToken token) => | ||
Task.FromResult(FileUpdateStatus.Complete); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace Windows.Storage.Provider | ||
{ | ||
/// <summary> | ||
/// Describes the status of a file update request. | ||
/// </summary> | ||
public enum FileUpdateStatus | ||
{ | ||
/// <summary> | ||
/// The file update was not fully completed and should be retried. | ||
/// </summary> | ||
Incomplete, | ||
|
||
/// <summary> | ||
/// The file update was completed successfully. | ||
/// </summary> | ||
Complete, | ||
|
||
/// <summary> | ||
/// User input (like credentials) is needed to update the file. | ||
/// </summary> | ||
UserInputNeeded, | ||
|
||
/// <summary> | ||
/// The remote version of the file was not updated because the storage location | ||
/// wasn't available. The file remains valid and subsequent updates | ||
/// to the file may succeed. | ||
/// </summary> | ||
CurrentlyUnavailable, | ||
|
||
/// <summary> | ||
/// The file is now invalid and can't be updated now or in the future. For example, | ||
/// this could occur if the remote version of the file was deleted. | ||
/// </summary> | ||
Failed, | ||
|
||
/// <summary> | ||
/// The file update was completed successfully and the file has been renamed. | ||
/// For example, this could occur if the user chose to save their changes under | ||
/// a different file name because of conflicting changes made to the remote | ||
/// version of the file. | ||
/// </summary> | ||
CompleteAndRenamed, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters