123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.Repostory.Model;
- namespace XdCxRhDW.Core.ObServer
- {
- public class PosObServer
- {
- private static PosObServer _ins =new PosObServer();
- private PosObServer()
- {
- }
- public static PosObServer Instance => _ins;
- /// <summary>
- /// 定位推送事件
- /// </summary>
- public event Action<PosRes> OnPosChanged;
- public void Sub(Action<PosRes> action)
- {
- OnPosChanged += action;
- }
- public void DisposeSub(Action<PosRes> action)
- {
- OnPosChanged -= action;
- }
- public void Pub(PosRes data)
- {
- OnPosChanged?.Invoke(data);
- }
- }
- }
|