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); } } }
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()); }); } } }
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()); }); } }