From 8f7dcc080d89f9b5dbe771d617be2d3c07eee7b1 Mon Sep 17 00:00:00 2001 From: oneRain Date: Thu, 29 Aug 2019 11:27:14 +0800 Subject: [PATCH] * AVCloud.cs: chore * AVFile.cs: * AVUploadProgressEventArgs.cs: * AVDownloadProgressEventArgs.cs: --- Storage/Storage/Public/AVCloud.cs | 24 ++++---------- .../Public/AVDownloadProgressEventArgs.cs | 15 --------- Storage/Storage/Public/AVFile.cs | 31 +++---------------- .../Public/AVUploadProgressEventArgs.cs | 1 - 4 files changed, 10 insertions(+), 61 deletions(-) delete mode 100644 Storage/Storage/Public/AVDownloadProgressEventArgs.cs diff --git a/Storage/Storage/Public/AVCloud.cs b/Storage/Storage/Public/AVCloud.cs index e0cb443..4aa4472 100644 --- a/Storage/Storage/Public/AVCloud.cs +++ b/Storage/Storage/Public/AVCloud.cs @@ -7,18 +7,8 @@ using System.Net.Http; namespace LeanCloud { /// - /// The AVCloud class provides methods for interacting with LeanCloud Cloud Functions. + /// AVCloud,提供与 LeanCloud 云函数交互的接口 /// - /// - /// For example, this sample code calls the - /// "validateGame" Cloud Function and calls processResponse if the call succeeded - /// and handleError if it failed. - /// - /// - /// var result = - /// await AVCloud.CallFunctionAsync<IDictionary<string, object>>("validateGame", parameters); - /// - /// public static class AVCloud { internal static AVCloudCodeController CloudCodeController { get { @@ -111,13 +101,12 @@ namespace LeanCloud { /// /// 发送手机短信,并指定模板以及传入模板所需的参数。 - /// Exceptions: - /// AVOSCloud.AVException: - /// 手机号为空。 + /// /// - /// Sms's template - /// Template variables env. - /// Sms's sign. + /// + /// + /// + /// /// public static Task RequestSMSCodeAsync( string mobilePhoneNumber, @@ -218,7 +207,6 @@ namespace LeanCloud { /// Verify the user's input of catpcha. /// /// User's input of this captcha. - /// CancellationToken. /// public Task VerifyAsync(string code) { return AVCloud.VerifyCaptchaAsync(code, Token); diff --git a/Storage/Storage/Public/AVDownloadProgressEventArgs.cs b/Storage/Storage/Public/AVDownloadProgressEventArgs.cs deleted file mode 100644 index 8858eaa..0000000 --- a/Storage/Storage/Public/AVDownloadProgressEventArgs.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace LeanCloud { - /// - /// Represents download progress. - /// - public class AVDownloadProgressEventArgs : EventArgs { - public AVDownloadProgressEventArgs() { } - - /// - /// Gets the progress (a number between 0.0 and 1.0) of a download. - /// - public double Progress { get; set; } - } -} diff --git a/Storage/Storage/Public/AVFile.cs b/Storage/Storage/Public/AVFile.cs index 4a40bfe..b359119 100644 --- a/Storage/Storage/Public/AVFile.cs +++ b/Storage/Storage/Public/AVFile.cs @@ -272,38 +272,15 @@ namespace LeanCloud { #region Save - /// - /// Saves the file to the LeanCloud cloud. - /// - public Task SaveAsync() { - return SaveAsync(null, CancellationToken.None); - } - - /// - /// Saves the file to the LeanCloud cloud. - /// - /// The cancellation token. - public Task SaveAsync(CancellationToken cancellationToken) { - return SaveAsync(null, cancellationToken); - } - - /// - /// Saves the file to the LeanCloud cloud. - /// - /// The progress callback. - public Task SaveAsync(IProgress progress) { - return SaveAsync(progress, CancellationToken.None); - } - /// /// Saves the file to the LeanCloud cloud. /// /// The progress callback. /// The cancellation token. - public Task SaveAsync(IProgress progress, - CancellationToken cancellationToken) { - if (this.isExternal) - return this.SaveExternal(); + public Task SaveAsync(IProgress progress = null, + CancellationToken cancellationToken = default) { + if (isExternal) + return SaveExternal(); return taskQueue.Enqueue( toAwait => FileController.SaveAsync(state, dataStream, progress, cancellationToken), cancellationToken) diff --git a/Storage/Storage/Public/AVUploadProgressEventArgs.cs b/Storage/Storage/Public/AVUploadProgressEventArgs.cs index dfa3112..5134fab 100644 --- a/Storage/Storage/Public/AVUploadProgressEventArgs.cs +++ b/Storage/Storage/Public/AVUploadProgressEventArgs.cs @@ -5,7 +5,6 @@ namespace LeanCloud { /// Represents upload progress. /// public class AVUploadProgressEventArgs : EventArgs { - public AVUploadProgressEventArgs() { } /// /// Gets the progress (a number between 0.0 and 1.0) of an upload.