diff --git a/Storage/Storage/Public/AVClient.cs b/Storage/Storage/Public/AVClient.cs index 0f9eb04..6aba4f3 100644 --- a/Storage/Storage/Public/AVClient.cs +++ b/Storage/Storage/Public/AVClient.cs @@ -13,8 +13,7 @@ using Newtonsoft.Json; namespace LeanCloud { /// - /// AVClient contains static functions that handle global - /// configuration for the LeanCloud library. + /// LeanCloud SDK 客户端类 /// public static class AVClient { public static readonly string[] DateFormatStrings = { @@ -27,51 +26,22 @@ namespace LeanCloud { }; /// - /// Represents the configuration of the LeanCloud SDK. + /// LeanCloud SDK 配置 /// public struct Configuration { /// - /// In the event that you would like to use the LeanCloud SDK - /// from a completely portable project, with no platform-specific library required, - /// to get full access to all of our features available on LeanCloud.com - /// (A/B testing, slow queries, etc.), you must set the values of this struct - /// to be appropriate for your platform. - /// - /// Any values set here will overwrite those that are automatically configured by - /// any platform-specific migration library your app includes. - /// - public struct VersionInformation { - /// - /// The build number of your app. - /// - public String BuildVersion { get; set; } - - /// - /// The human friendly version number of your happ. - /// - public String DisplayVersion { get; set; } - - /// - /// The operating system version of the platform the SDK is operating in.. - /// - public String OSVersion { get; set; } - - } - - /// - /// The LeanCloud application ID of your app. + /// App Id /// public string ApplicationId { get; set; } /// - /// The LeanCloud application key for your app. + /// App Key /// public string ApplicationKey { get; set; } /// - /// The LeanCloud master key for your app. + /// Master Key /// - /// The master key. public string MasterKey { get; set; } /// @@ -79,11 +49,6 @@ namespace LeanCloud { /// public IDictionary AdditionalHTTPHeaders { get; set; } - /// - /// The version information of your application environment. - /// - public VersionInformation VersionInfo { get; set; } - /// /// 存储服务器地址 /// @@ -119,7 +84,7 @@ namespace LeanCloud { } /// - /// The current configuration that LeanCloud has been initialized with. + /// LeanCloud SDK 当前配置 /// public static Configuration CurrentConfiguration { get; internal set; } @@ -129,31 +94,23 @@ namespace LeanCloud { } } - public static string Name { + internal static string Name { get { return "LeanCloud-CSharp-SDK"; } } - /// - /// 当前 SDK 版本号 - /// - public static string Version { + internal static string Version { get { return "0.1.0"; } } /// - /// Authenticates this client as belonging to your application. This must be - /// called before your application can use the LeanCloud library. The recommended - /// way is to put a call to AVClient.Initialize in your - /// Application startup. + /// 初始化 LeanCloud SDK /// - /// The Application ID provided in the LeanCloud dashboard. - /// - /// The .NET API Key provided in the LeanCloud dashboard. - /// + /// App Id + /// App Key public static void Initialize(string applicationId, string applicationKey) { Initialize(new Configuration { ApplicationId = applicationId, @@ -179,60 +136,35 @@ namespace LeanCloud { } /// - /// Gets or sets a value indicating whether send the request to production server or staging server. + /// 是否使用生产环境 /// - /// true if use production; otherwise, false. public static bool UseProduction { get; set; } + /// + /// 是否使用 MasterKey + /// public static bool UseMasterKey { get; set; } /// - /// Authenticates this client as belonging to your application. This must be - /// called before your application can use the LeanCloud library. The recommended - /// way is to put a call to AVClient.Initialize in your - /// Application startup. + /// 初始化 LeanCloud /// - /// The configuration to initialize LeanCloud with. - /// + /// 初始化配置 public static void Initialize(Configuration configuration) { - Config(configuration); + CurrentConfiguration = configuration; AVObject.RegisterSubclass(); AVObject.RegisterSubclass(); } - internal static void Config(Configuration configuration) { - lock (mutex) { - CurrentConfiguration = configuration; - } - } - internal static void Clear() { AVPlugins.Instance.AppRouterController.Clear(); AVPlugins.Instance.Reset(); } - /// - /// Switch app. - /// - /// Configuration. - public static void Switch(Configuration configuration) { - Clear(); - Initialize(configuration); - } - - public static void Switch(string applicationId, string applicationKey) { - var configuration = new Configuration { - ApplicationId = applicationId, - ApplicationKey = applicationKey - }; - Switch(configuration); - } - public static string BuildQueryString(IDictionary parameters) { return string.Join("&", (from pair in parameters let valueString = pair.Value as string