Esempio n. 1
0
        public TimeoutDelegateCancelPayload(TimeoutDelegatePayload timeoutPayload,
                                            Delegate onCancelTimeoutMethod = null, params object[] onCancelTimeoutMethodArgs)
            : base(onCancelTimeoutMethod, onCancelTimeoutMethodArgs)
        {
            ArgumentValidator.AssertNotNull(timeoutPayload, "timeoutPayload");

            TimeoutPayload = timeoutPayload;
        }
Esempio n. 2
0
        private void OnTimeoutRegistration(TimeoutDelegatePayload arg)
        {
            try
            {
                ArgumentValidator.AssertNotNull(arg, "arg");
                ArgumentValidator.AssertNotNull(arg.Method, "arg.Method");

                arg.TimeoutStartTime = DateTime.Now;
                Items.Add(arg);
            }
            finally
            {
                if (Items.Count > 0)
                {
                    Timer.StartTimer();
                }
            }
        }