private void initTaskScheduler() { _taskScheduler.Start(); _taskScheduler.DoWork = () => { try { ProcessesListManager.UpdateProcesses(GuiModelData, _settings); if (GuiModelData.RoutedConnectionsList.Count > 500) { GuiModelData.RoutedConnectionsList.Clear(); } } catch (Exception ex) { ExceptionLogger.LogExceptionToFile(ex); } }; }