public EventInfo[] GetEvents() { EventInfo[] eifs = this.GetType().GetEvents(); if (WatchForSignals == null || WatchForSignals.Count == 0) { return(eifs); } else { EventInfo[] evs = new EventInfo[WatchForSignals.Count]; int i = 0; foreach (KeyValuePair <string, string> kv in WatchForSignals) { WatchSignal ws; if (!_signEvents.TryGetValue(kv.Key, out ws)) { ws = new WatchSignal(kv.Key); _signEvents.Add(kv.Key, ws); } evs[i++] = new SignalEvent(ws); } EventInfo[] ef = new EventInfo[eifs.Length + evs.Length]; evs.CopyTo(ef, 0); eifs.CopyTo(ef, evs.Length); return(ef); } }
public SignalEvent(WatchSignal ws) { _signal = ws; _info = typeof(WatchSignal).GetEvent("Event"); }