示例#1
0
 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);
     }
 }
示例#2
0
 public SignalEvent(WatchSignal ws)
 {
     _signal = ws;
     _info   = typeof(WatchSignal).GetEvent("Event");
 }