Exemplo n.º 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 };
                //}
            }
        public override void Dispose()
        {
            lock (_syncRoot)
            {
                if (_pool != null)
                {
                    _pool.Dispose();
                }
                _pool = null;
            }

            base.Dispose();
        }
Exemplo n.º 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 };
                //}
            }