protected void CallBack(T innerParmas)
 {
     if (MonitorCallBack != null)
     {
         MonitorCallBack.Invoke(innerParmas);
     }
 }
        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);
                }
            }
        }
Exemple #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());
                    });
                }
            }
        }
Exemple #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());
                });
            }
        }