1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class EventProxy : ProxyBase<EventProxy>
- {
- public EventProxy() => opeCode = OpeCode.ope_event;
- /// <summary>
- /// 拉取新的角标通知
- /// </summary>
- /// <param name="callback"></param>
- public void GetNewCornerSignNotifications(Action<List<int>> callback)
- {
- Post(CmdCode.cmd_event_GetConerSignNotifications, new object[] { }, resp =>
- {
- var ret= resp.result.TryGetValue("notifications", out var jo) ? jo.ToObject<List<int>>() : new List<int>();
- callback?.Invoke(ret);
- });
- }
- /// <summary>
- /// 清除指定类型的角标
- /// </summary>
- /// <param name="cType">清理的种类</param>
- /// <param name="callback">返回最新角标信息</param>
- public void ClearCornerSignNotification(CornerSignType cType, Action<List<int>> callback)
- {
- Post(CmdCode.cmd_event_ClearNotifications, new object[] { cType }, resp =>
- {
- var ret = resp.result.TryGetValue("notifications", out var jo)?jo.ToObject<List<int>>() : new List<int>();
- callback?.Invoke(ret);
- });
- }
- }
|