Esempio n. 1
0
 protected void CallBack(T innerParmas)
 {
     if (MonitorCallBack != null)
     {
         MonitorCallBack.Invoke(innerParmas);
     }
 }
Esempio n. 2
0
        private void CyclicTask()
        {
            while (!isStop)
            {
                try
                {
                    if (MonitorCallBack == null)
                    {
                        continue;
                    }

                    var result = ExecTaskAndGetResult();
                    if (result != null)
                    {
                        MonitorCallBack.Invoke(result);
                    }

                    Thread.Sleep(sleepInterval);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Esempio n. 3
0
        private void CyclicTask()
        {
            while (!isStop)
            {
                try
                {
                    if (MonitorCallBack == null)
                    {
                        continue;
                    }

                    var result = ExecTaskAndGetResult();
                    if (result != null)
                    {
                        MonitorCallBack.Invoke(result);
                    }

                    Thread.Sleep(sleepInterval);
                }
                catch (Exception ex)
                {
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        Logger.Singleton.Error(ex.ToString());
                    });
                }
            }
        }
Esempio n. 4
0
        protected void CallBack(T innerParmas)
        {
            if (MonitorCallBack == null)
            {
                return;
            }

            try
            {
                MonitorCallBack.Invoke(innerParmas);
            }
            catch (Exception ex)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    Logger.Singleton.Error(ex.ToString());
                });
            }
        }