* AVCloud.cs: chore

* AVFile.cs:
* AVUploadProgressEventArgs.cs:
* AVDownloadProgressEventArgs.cs:
oneRain 2019-08-29 11:27:14 +08:00
parent e4681cfa40
commit 8f7dcc080d
4 changed files with 10 additions and 61 deletions

View File

@ -7,18 +7,8 @@ using System.Net.Http;
namespace LeanCloud {
/// <summary>
/// The AVCloud class provides methods for interacting with LeanCloud Cloud Functions.
/// AVCloud提供与 LeanCloud 云函数交互的接口
/// </summary>
/// <example>
/// For example, this sample code calls the
/// "validateGame" Cloud Function and calls processResponse if the call succeeded
/// and handleError if it failed.
///
/// <code>
/// var result =
/// await AVCloud.CallFunctionAsync&lt;IDictionary&lt;string, object&gt;&gt;("validateGame", parameters);
/// </code>
/// </example>
public static class AVCloud {
internal static AVCloudCodeController CloudCodeController {
get {
@ -111,13 +101,12 @@ namespace LeanCloud {
/// <summary>
/// 发送手机短信,并指定模板以及传入模板所需的参数。
/// Exceptions:
/// AVOSCloud.AVException:
/// 手机号为空。
/// </summary>
/// <param name="mobilePhoneNumber"></param>
/// <param name="template">Sms's template</param>
/// <param name="env">Template variables env.</param>
/// <param name="sign">Sms's sign.</param>
/// <param name="template"></param>
/// <param name="env"></param>
/// <param name="sign"></param>
/// <param name="validateToken"></param>
/// <returns></returns>
public static Task RequestSMSCodeAsync(
string mobilePhoneNumber,
@ -218,7 +207,6 @@ namespace LeanCloud {
/// Verify the user's input of catpcha.
/// </summary>
/// <param name="code">User's input of this captcha.</param>
/// <param name="cancellationToken">CancellationToken.</param>
/// <returns></returns>
public Task VerifyAsync(string code) {
return AVCloud.VerifyCaptchaAsync(code, Token);

View File

@ -1,15 +0,0 @@
using System;
namespace LeanCloud {
/// <summary>
/// Represents download progress.
/// </summary>
public class AVDownloadProgressEventArgs : EventArgs {
public AVDownloadProgressEventArgs() { }
/// <summary>
/// Gets the progress (a number between 0.0 and 1.0) of a download.
/// </summary>
public double Progress { get; set; }
}
}

View File

@ -272,38 +272,15 @@ namespace LeanCloud {
#region Save
/// <summary>
/// Saves the file to the LeanCloud cloud.
/// </summary>
public Task SaveAsync() {
return SaveAsync(null, CancellationToken.None);
}
/// <summary>
/// Saves the file to the LeanCloud cloud.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
public Task SaveAsync(CancellationToken cancellationToken) {
return SaveAsync(null, cancellationToken);
}
/// <summary>
/// Saves the file to the LeanCloud cloud.
/// </summary>
/// <param name="progress">The progress callback.</param>
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress) {
return SaveAsync(progress, CancellationToken.None);
}
/// <summary>
/// Saves the file to the LeanCloud cloud.
/// </summary>
/// <param name="progress">The progress callback.</param>
/// <param name="cancellationToken">The cancellation token.</param>
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress,
CancellationToken cancellationToken) {
if (this.isExternal)
return this.SaveExternal();
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress = null,
CancellationToken cancellationToken = default) {
if (isExternal)
return SaveExternal();
return taskQueue.Enqueue(
toAwait => FileController.SaveAsync(state, dataStream, progress, cancellationToken), cancellationToken)

View File

@ -5,7 +5,6 @@ namespace LeanCloud {
/// Represents upload progress.
/// </summary>
public class AVUploadProgressEventArgs : EventArgs {
public AVUploadProgressEventArgs() { }
/// <summary>
/// Gets the progress (a number between 0.0 and 1.0) of an upload.