void doStart(string data) { ProcessesListManager.UpdateProcesses(GuiModelData, _settings); if (Designer.IsInDesignModeStatic) { return; } if (string.IsNullOrWhiteSpace(GuiModelData.DefaultServerInfo.ServerIP)) { return; } _poxyRouter.FiddlerPort = GuiModelData.ProxifierPort; _poxyRouter.DefaultServerInfo = new ServerInfo { ServerIP = GuiModelData.DefaultServerInfo.ServerIP, ServerPort = GuiModelData.DefaultServerInfo.ServerPort, ServerType = GuiModelData.DefaultServerInfo.ServerType }; _poxyRouter.ProcessesList = GuiModelData.ProcessesList; _poxyRouter.RoutedConnectionsList = GuiModelData.RoutedConnectionsList; _poxyRouter.Start(); GuiModelData.IsEnabled = false; }
private void setupCommands() { DoStart = new DelegateCommand <string>(doStart, canDoStart); DoStop = new DelegateCommand <string>(doStop, data => true); DoSave = new DelegateCommand <string>(data => saveSettings(), data => true); DoClearLogs = new DelegateCommand <string>(data => GuiModelData.RoutedConnectionsList.Clear(), data => true); DoClearLogsList = new DelegateCommand <string>(data => GuiModelData.RoutedConnectionsList.Clear(), data => true); DoUseDefaultSettings = new DelegateCommand <string>(doUseDefaultSettings, data => true); DoRefresh = new DelegateCommand <string>(data => ProcessesListManager.UpdateProcesses(GuiModelData, _settings), data => true); DoCopySelectedLine = new DelegateCommand <string>(doCopySelectedLine, data => true); DoCopyAllLines = new DelegateCommand <string>(doCopyAllLines, data => true); }
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); } }; }