/// <summary>
        /// Event handler for Application splash screen timer time elapsed event.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="eventArgs">Event arguments.</param>
        private void applicationSplashScreenTimer_Elapsed(object sender, ST.ElapsedEventArgs eventArgs)
        {
            if (loadingCount >= 100)
            {
                applicationSplashScreenTimer.Stop();
                applicationSplashScreenTimer.Dispose();
                applicationSplashScreenTimer = null;

                appSplashScreen.AppLoadingCompleted();
                appSplashScreen = null;

                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(StartMainApplication));
            }
            else
            {
                loadingCount += 1;
                appSplashScreen.AppLoadingPercentCompleted(loadingCount);
            }
        }
Пример #2
0
 private void ProcessQueue(object sender, Timers.ElapsedEventArgs e)
 {
   while (messageQueue.Count != 0) {
     var msg = (Datagram)null;
     if (!messageQueue.TryPeek(out msg)) {
       continue;
     }
     if (msg != null && (running || msg.Sticky)) {
       msg.Send();
       if (msg.SendCount > DATAGRAMS_PER_MESSAGE) {
         messageQueue.TryDequeue(out msg);
       }
       break;
     }
     else {
       messageQueue.TryDequeue(out msg);
     }
   }
   datagramPosted.Set();
   queueTimer.Enabled = messageQueue.Count != 0;
   queueTimer.Interval = random.Next(50, running ? 300 : 100);
 }
Пример #3
0
        /// <summary>
        /// Called when the quit timer exits without any user actions.
        /// </summary>
        private void OnDelayedClose(object sender, Timers.ElapsedEventArgs ev)
        {
            ProgressTray.Close();
            ProgressForm.Close();

            Cleanup();

            Application.Exit();
        }
Пример #4
0
 private void Tick(object sender, Timers.ElapsedEventArgs e)
 {
   Debug("Sending SSDP notifications!");
   notificationTimer.Interval = random.Next(60000, 120000);
   NotifyAll();
 }
Пример #5
0
        /// <summary>
        /// Event Handler para los intervalos del Timer.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _Timer_Elapsed(object sender, Timer.ElapsedEventArgs e)
        {
            _Timer.Stop();
            ClearBlockingMarks();
            _Timer.Start();
            //try
            //{
            /// Crea un thread para la  ejecución de ClearBlockingMarks.
            //Thread thread = new Thread(new ThreadStart(ClearBlockingMarks));
            //thread.Start();

            /// Espera hasta que se cumpla el tiempo estipulado
            /// de espera.
            //thread.Join(_WaitForComplete * 1000);

            ///// Si el thread todavía está vivo lo mata.
            //if (thread.IsAlive)
            //{
            //    BlockingHelper.WriteLog("\r\nHay un thread que ha superado el tiempo de espera estipulado.",
            //        EventLogEntryType.Error);

            //    thread.Abort();

            //    throw new Exception("\r\nHay un thread que ha superado el tiempo de espera estipulado.");
            //}
            //}
            //catch (Exception ex)
            //{

            //    BlockingHelper.WriteLog("\r\nSe produjo una excepción al llamar a " +
            //        "ClearBlockingMarks.\r\nDescripción  Técnica: " + ex.Message +
            //        "\r\n\r\n" + ex.ToString(), EventLogEntryType.Error);
            //}
        }
 void t_Elapsed(object sender, Timer.ElapsedEventArgs e)
 {
     if (lstLogs.Count != 0)
     {
         SendAllEvents(lstLogs.ToArray());
     }
 }
Пример #7
0
 void _PollTimer_Elapsed(object sender, T.ElapsedEventArgs e)
 {
     if(!AssocSock.Poll(1000, SelectMode.SelectWrite))
         NetController.Instance.ClientPingFail(ID);
 }
Пример #8
0
        // USBポートを監視し、USBメモリの接続が認められればDBへの挿入処理を呼び出す
        public void insertUsbLog(object source, TM.ElapsedEventArgs e)
        {
            //public void insertUsbLog() {
            for (int i = 0; i > gridActionLog.RowCount; i++) {
                gridActionLog.Rows.RemoveAt(i);
            }

            Mos mos = new Mos();
            // USBメモリ情報を取得
            Dictionary<string, string> usbInfo = mos.GetUsbInformation();

            // ホワイトリストと突き合わせた結果の警告値を取得
            int alertMark = CheckWhitelist(usbInfo);

            if (alertMark == 1 && connNgUsb == 0) {
                connNgUsb = 1;

                MessageBox.Show(
                    "ホワイトリストに登録されていないUSBメモリの接続を確認しました。直ちに使用を中止し、接続を解除してください。",
                    "USB LOGGER"
                );
            } else if (alertMark == 1 && connNgUsb == 1) {
            }

            if (usbInfo.Equals(null)) {
                connUsbInfo.Clear();
            }

            if (connUsbInfo["usbSerialNo"] != usbInfo["usbSerialNo"]) {
                connUsbInfo.Clear();

                DoInsertUsbLog(usbInfo, connUsbInfo, alertMark);
            }
        }