/// <summary> /// ����¼����� /// </summary> /// <param name="evt"></param> internal void AddEvent(EventInvoke evt) { lock (m_eventLock) { m_EventList.Add(evt); } }
/// <summary> /// 添加事件代理 /// </summary> /// <param name="evt"></param> internal void AddEvent(EventInvoke evt) { lock (m_eventLock) { m_EventList.Add(evt); } }
/// <summary> /// 委托执行一个函数 /// </summary> /// <param name="Contrl">委托在这个控件所在的线线程中</param> /// <param name="invoke">Comm.Function.EventInvoke</param> /// <param name="Params"></param> public static void Invoke(Control Contrl, EventInvoke invoke, params object[] Params) { if (Contrl.IsHandleCreated && !Contrl.IsDisposed) { if (Contrl.InvokeRequired) { Contrl.Invoke(invoke, Params); } else { invoke(invoke, Params); } } }
public int addEventListener(int id, EventInvoke callback) { List <EventInvoke> listeners = null; if (listener_.ContainsKey(id)) { listeners = listener_[id]; } else { listeners = new List <EventInvoke>(); listener_[id] = listeners; } listeners.Add(callback); return(0); }