Esempio n. 1
0
        /// <summary>
        /// リストからクライアントを削除。
        /// 指定したクライアントがリストに存在しなければ何もしない。
        /// </summary>
        /// <param name="client">自動更新の対象から外すクライアント</param>
        public override void Remove(ThreadControl client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            int index = IndexOf(client);

            if (index != -1)
            {
                // イベントを削除
                client.Complete -= new CompleteEventHandler(OnComplete);

                TimerObject timer = (TimerObject)timerCollection[index];
                timerCollection.Remove(timer);

                if (timer.Enabled)
                {
                    timer.Stop();
                    Increment();
                }

                timer.Dispose();
            }

            if (timerCollection.Count == 0)
            {
                running = false;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 更新イベント発生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnTimer(object sender, ElapsedEventArgs e)
        {
            TimerObject timer = (TimerObject)sender;

            timer.Stop();
            ThreadControl thread = timer.Thread;

            if (thread.IsOpen)
            {
                thread.Reload();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 更新イベント発生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnTimer(object sender, ElapsedEventArgs e)
        {
//			Timer timer = (Timer)sender;
//			timer.Stop();

            try {
                current.Stop();
                ThreadControl thread = current.Thread;

                if (thread.IsOpen)
                {
                    thread.Reload();
                }
            }
            catch (Exception ex) {
                TwinDll.Output(ex);
            }
        }