コード例 #1
0
            /// <summary>
            /// Constructor.
            /// </summary>
            public TargetInfo(string invokerName, object target, FastInvokeHelper.FastInvokeHandlerDelegate delegateInstance,
                              bool poolAsFirstParameter, ThreadPoolFast pool, params object[] args)
            {
                DelegateInstance = delegateInstance;
                Target           = target;
                InvokerName      = invokerName;

                if (poolAsFirstParameter)
                {
                    Args = new object[] { pool, args };
                }
                else
                {
                    Args = args;
                }

                //if (args != null && args.Length == 1)
                //{// Single parameter pass.
                //    Args = new object[] { pool, args[0] };
                //}
                //else
                //{
                //    Args = new object[] { pool, args };
                //}
            }
コード例 #2
0
        public void Dispose()
        {
            Stop();

            ThreadPoolFast.StopThread(_workerInternalThread, true, 200, 500);

            //if (_workerInternalThread != null && _workerInternalThread.ThreadState == ThreadState.Running)
            //{
            //    // Allow a few ms for the thread to try and stop as it should.
            //    Thread.Sleep(500);

            //    if (_workerInternalThread.ThreadState == ThreadState.Running)
            //    {
            //        SystemMonitor.Warning("Aborting background message processing thread.");
            //        _workerInternalThread.Abort();
            //    }
            //}
        }
コード例 #3
0
            /// <summary>
            /// Constructor.
            /// </summary>
            public TargetInfo(string invokerName, object target, FastInvokeHelper.FastInvokeHandlerDelegate delegateInstance,
                bool poolAsFirstParameter, ThreadPoolFast pool, params object[] args)
            {
                DelegateInstance = delegateInstance;
                Target = target;
                InvokerName = invokerName;

                if (poolAsFirstParameter)
                {
                    Args = new object[] { pool, args };
                }
                else
                {
                    Args = args;
                }

                //if (args != null && args.Length == 1)
                //{// Single parameter pass.
                //    Args = new object[] { pool, args[0] };
                //}
                //else
                //{
                //    Args = new object[] { pool, args };
                //}
            }