Beispiel #1
0
 public void RaiseNewEvent(object sender, CallMomEventArgs data, int delay = 0)
 {
     Task.Run(async() => {
         if (delay > 0)
         {
             await Task.Delay(delay);
         }
         OnDataChanged(sender, data);
     });
 }
Beispiel #2
0
 public virtual void OnDataChanged(object sender, CallMomEventArgs data)
 {
     lock (_Lock) {
         //run in new thread
         Task.Run(() => {
             var handler = CoreEvents;
             if (handler != null)
             {
                 handler(sender, data);
             }
         });
     }
 }