Example #1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     mDelegate   = null;
     mParameters = null;
     mCallBack   = null;
     mState      = null;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventDataContainer"/> class.
 /// </summary>
 /// <param name="del">The del.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="controlInvoke">if set to <c>true</c> [control invoke].</param>
 /// <param name="parallelInvocation">if set to <c>true</c> [parallel invocation].</param>
 /// <param name="callBack">The call back.</param>
 /// <param name="state">The state.</param>
 internal EventDataContainer(Delegate del,
                             Object[] parameters,
                             bool controlInvoke,
                             bool parallelInvocation,
                             AsyncRaiserCallback callBack,
                             Object state)
 {
     this.mDelegate           = del;
     this.mParameters         = parameters;
     this.mCallBack           = callBack;
     this.mControlInvoke      = controlInvoke;
     this.mParallelInvocation = parallelInvocation;
     this.mState = state;
 }
Example #3
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     mDelegate = null;
     mParameters = null;
     mCallBack = null;
     mState = null;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventDataContainer"/> class.
 /// </summary>
 /// <param name="del">The del.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="controlInvoke">if set to <c>true</c> [control invoke].</param>
 /// <param name="parallelInvocation">if set to <c>true</c> [parallel invocation].</param>
 /// <param name="callBack">The call back.</param>
 /// <param name="state">The state.</param>
 internal EventDataContainer(Delegate del,
     Object[] parameters,
     bool controlInvoke,
     bool parallelInvocation,
     AsyncRaiserCallback callBack,
     Object state)
 {
     this.mDelegate = del;
     this.mParameters = parameters;
     this.mCallBack = callBack;
     this.mControlInvoke = controlInvoke;
     this.mParallelInvocation = parallelInvocation;
     this.mState = state;
 }
Example #5
0
        public static void CallDelegatorByAsync(Delegate dl, Object[] parameters, bool controlInvoke, bool parallelInvocation, AsyncRaiserCallback callback, Object state)
        {
            TypeContainer container = null;
            TypeNameResolver name_res = new TypeNameResolver();

            lock (mTypeContainers)
            {
                if (mTypeContainers.ContainsKey(name_res.CallerTypeName))
                {
                    container = mTypeContainers[name_res.CallerTypeName];
                }
                else
                {
                    container = new TypeContainer();
                    mTypeContainers[name_res.CallerTypeName] = container;
                }

                if (container.Thread == null)
                {
                    container.Thread = new Thread(new ThreadStart(EventExecutorThreadMain));
                    container.Thread.IsBackground = true;
                    container.Thread.Name = name_res.CallerTypeName;
                    container.Thread.Start();
                }
            }

            lock (container.Queue)
            {
                container.Queue.Enqueue(new EventDataContainer(dl, parameters, controlInvoke, parallelInvocation, callback, state));
            }

            container.ExecutorThreadSemaphore.Release();
        }
Example #6
0
 public static void CallDelegatorByAsync(Delegate dl, Object[] parameters, AsyncRaiserCallback callback, Object state)
 {
     CallDelegatorByAsync(dl, parameters, false, false, callback, state);
 }
Example #7
0
        public static void CallDelegatorByAsync(Delegate dl, Object[] parameters, bool controlInvoke, bool parallelInvocation, AsyncRaiserCallback callback, Object state)
        {
            TypeContainer    container = null;
            TypeNameResolver name_res  = new TypeNameResolver();

            lock (mTypeContainers)
            {
                if (mTypeContainers.ContainsKey(name_res.CallerTypeName))
                {
                    container = mTypeContainers[name_res.CallerTypeName];
                }
                else
                {
                    container = new TypeContainer();
                    mTypeContainers[name_res.CallerTypeName] = container;
                }

                if (container.Thread == null)
                {
                    container.Thread = new Thread(new ThreadStart(EventExecutorThreadMain));
                    container.Thread.IsBackground = true;
                    container.Thread.Name         = name_res.CallerTypeName;
                    container.Thread.Start();
                }
            }

            lock (container.Queue)
            {
                container.Queue.Enqueue(new EventDataContainer(dl, parameters, controlInvoke, parallelInvocation, callback, state));
            }

            container.ExecutorThreadSemaphore.Release();
        }
Example #8
0
 public static void CallDelegatorByAsync(Delegate dl, Object[] parameters, AsyncRaiserCallback callback, Object state)
 {
     CallDelegatorByAsync(dl, parameters, false, false, callback, state);
 }