Inheritance: GenericMessageContainer
Beispiel #1
0
        public static void ThreadDispatch(StatefulMessageHandler cb, object state)
        {
            StatefulMessageContainer smc = new StatefulMessageContainer(cb, state, false);
            Thread t = new Thread(new ThreadStart(smc.Run));

            t.IsBackground = true;
            t.Start();
        }
Beispiel #2
0
        public static void GuiSyncDispatch(StatefulMessageHandler cb, object state)
        {
            if (IsGuiThread)
            {
                cb(state);
                return;
            }

            StatefulMessageContainer mc = new StatefulMessageContainer(cb, state, true);

            lock (mc) {
                QueueMessage(mc);
                Monitor.Wait(mc);
            }
            if (mc.Exception != null)
            {
                throw new Exception(errormsg, mc.Exception);
            }
        }
Beispiel #3
0
 public static void ThreadDispatch(StatefulMessageHandler cb, object state)
 {
     StatefulMessageContainer smc = new StatefulMessageContainer (cb, state, false);
     Thread t = new Thread (new ThreadStart (smc.Run));
     t.IsBackground = true;
     t.Start ();
 }
Beispiel #4
0
        public static void GuiSyncDispatch(StatefulMessageHandler cb, object state)
        {
            if (IsGuiThread) {
                cb (state);
                return;
            }

            StatefulMessageContainer mc = new StatefulMessageContainer (cb, state, true);
            lock (mc) {
                QueueMessage (mc);
                Monitor.Wait (mc);
            }
            if (mc.Exception != null)
                throw new Exception (errormsg, mc.Exception);
        }