public void Unsubscribe(Guid guid) { Action <string> action; var foo = AllMessageEvent.TryGetValue(guid, out action); if (foo == true) { var success = AllMessageEvent.TryRemove(guid, out action); if (success == false) { //Logger.LogError($"移除 AllMessageEvent ({guid}) 失敗"); } } else { //Logger.LogError($"沒有發現要移除 AllMessageEvent ({guid})"); } return; }
public int GetAllSubscriber() { int all = AllMessageEvent.Count(); return(all); }
public void Subscribe(Guid guid, Action <string> action) { AllMessageEvent.TryAdd(guid, action); return; }