Ejemplo n.º 1
0
        internal void SignalEvent(
            HardwareComponentEventHandler callback, ElementComponent componenet)
        {
            // enqueue the info about the callback for later use
            CallbackInfo ci = new CallbackInfo();

            ci.callback  = callback;
            ci.component = componenet;
            lock (callbacks)
            {
                if (!callbacks.Contains(ci))
                {
                    callbacks.Enqueue(ci);
                }
            }

            // if asyncCallbacks are enabled, then go ahead and run them
            // on this thread - otherwise they wait for a explicit call to
            // PumpEvents() by the user (or the run loop)
            if (asyncCallbacks)
            {
                PumpEvents();
            }
            else
            {
                // this signals the Run() loop that there are
                // events to be run
                eventsReady.Set();
            }
        }
Ejemplo n.º 2
0
		internal void SignalEvent(
			HardwareComponentEventHandler callback, ElementComponent componenet)
		{
			// enqueue the info about the callback for later use
			CallbackInfo ci = new CallbackInfo();
			ci.callback = callback;
			ci.component = componenet;
			lock (callbacks)
			{
				if(!callbacks.Contains(ci))
				{
					callbacks.Enqueue(ci);
				}
			}

			// if asyncCallbacks are enabled, then go ahead and run them 
			// on this thread - otherwise they wait for a explicit call to
			// PumpEvents() by the user (or the run loop)
			if (asyncCallbacks)
			{
				PumpEvents();
			}
			else
			{
				// this signals the Run() loop that there are 
				// events to be run
				eventsReady.Set();
			}
		}