| | |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | #if DEBUG |
| | | using Xamarin.Essentials; |
| | | #endif |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | |
| | | List<PushMessageInfo> PushMessageInfoList = new List<PushMessageInfo>(); |
| | | |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | UnregisterGetPushMessageAction(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | AddTopMenuView(); |
| | | AddMessageView(); |
| | | MenuButtonSelect(showMesType); |
| | | |
| | | RegisterGetPushMessageAction(); |
| | | //测试代码 |
| | | //AddEmptyTipView(); |
| | | //TestLoad(); |
| | |
| | | MenuButtonSelect(0); |
| | | }; |
| | | allMenuButton.SelectAction = allAction; |
| | | |
| | | #if DEBUG |
| | | //测试提前当前推送ID |
| | | allMenuButton.ImageButton.MouseLongEventHandler = (sender, e) => |
| | | { |
| | | CopyToClipboard("推送ID:" + OnAppConfig.Instance.PushId); |
| | | }; |
| | | #endif |
| | | #endregion |
| | | |
| | | #region 分享与功能 |
| | |
| | | bodyScrolView.RemoveAll(); |
| | | PushMessageInfoList.Clear(); |
| | | YearMark = "";//标记清空 |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) |
| | | { |
| | | AddEmptyTipView(); |
| | | return; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 标记所有推送消息已读 |
| | | /// </summary> |
| | | void PushSerivceMarkAllMessageRead() { |
| | | void PushSerivceMarkAllMessageRead() |
| | | { |
| | | new Thread(() => |
| | | { |
| | | var result = new HttpServerRequest().PushSerivceMarkAllMessageRead(); |
| | |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 注册收到推送监听 |
| | | /// </summary> |
| | | void RegisterGetPushMessageAction() |
| | | { |
| | | //HDLCommon.GetPushMessageAction = () => |
| | | //{ |
| | | // if (bodyView != null) |
| | | // { |
| | | // Utlis.WriteLine("GetPushMessageAction M收到推送"); |
| | | // GetPushMessageList(showMesType); |
| | | // } |
| | | //}; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 取消收到推送监听 |
| | | /// </summary> |
| | | void UnregisterGetPushMessageAction() |
| | | { |
| | | //HDLCommon.GetPushMessageAction = null; |
| | | } |
| | | |
| | | #if DEBUG |
| | | |
| | | /// <summary> |
| | | /// 复制到剪切板 |
| | | /// </summary> |
| | | /// <param name="text"></param> |
| | | void CopyToClipboard(string text) |
| | | { |
| | | Clipboard.SetTextAsync(text); |
| | | Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); |
| | | } |
| | | #endif |
| | | |
| | | } |
| | | |