Exemplo n.º 1
0
 /// <summary>
 /// 添加事件
 /// </summary>
 /// <param name="groupID">事件组ID</param>
 /// <param name="bodyID">事件体ID</param>
 /// <param name="func">事件</param>
 public void Add(object groupID, object bodyID, EventDele_1 func1)
 {
     lock (eventDic)
     {
         if (!eventDic.ContainsKey(groupID))
         {
             eventDic[groupID] = new EventGroup(groupID);
         }
         eventDic[groupID].Add(bodyID, func1);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加无参,无返回值的事件到事件代理中心
 /// </summary>
 /// <param name="eventID">事件ID</param>
 /// <param name="func">无参,无返回值的事件</param>
 public void Add(object groupID, Action func)
 {
     lock (eventDic)
     {
         if (!eventDic.ContainsKey(groupID))
         {
             eventDic[groupID] = new EventGroup(groupID);
         }
         eventDic[groupID].Add(func);
     }
 }