示例#1
0
 /// <summary>
 /// 异步设置对应 <see cref="Session"/> 实例的 Websocket
 /// </summary>
 /// <param name="enabled">是否启用</param>
 private async Task SetWebsocketAsync(bool enabled) => (await ApiMethods.ConfigAsync(Session.Settings.HttpUri, Session.SessionKey, enabled)).CheckError();
示例#2
0
 /// <summary>
 /// 异步获取对应 <see cref="Session"/> 实例的 API 配置
 /// </summary>
 public async Task <ApiConfig> GetApiConfigAsync() => JsonConvert.DeserializeObject <ApiConfig>(await ApiMethods.GetConfigAsync(Session.Settings.HttpUri, Session.SessionKey));
示例#3
0
 /// <summary>
 /// 异步设置对应 <see cref="Session"/> 实例的缓存大小
 /// </summary>
 /// <param name="size">缓存大小</param>
 public async Task SetCacheSizeAsync(int size) => (await ApiMethods.ConfigAsync(Session.Settings.HttpUri, Session.SessionKey, size)).CheckError();
示例#4
0
 /// <summary>
 /// 异步获取 API 信息
 /// </summary>
 public async Task <ApiInfo> GetApiInfoAsync() => JObject.Parse((await ApiMethods.GetAboutAsync(Session.Settings.HttpUri)).CheckError())["data"].ToObject <ApiInfo>();