public static void Invoke(EventFunc dele)
        {
            ThreadEvent e = new ThreadEvent(dele);

            e.handle = GCHandle.Alloc(e);              // we don't want the GC to collect the event too early
            PostEvent(qApp.receiver, e);
        }
 public override bool OnEvent(QEvent e)
 {
     if (e != null && e.type() == QEvent.Type.User)
     {
         ThreadEvent my = e as ThreadEvent;
         if (e != null)
         {
             my.dele();
             my.handle.Free();                      // free the handle so the event can be collected
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
 public static void Invoke(EventFunc dele)
 {
     ThreadEvent e = new ThreadEvent(dele);
     e.handle = GCHandle.Alloc(e);  // we don't want the GC to collect the event too early
     PostEvent(qApp.receiver, e);
 }