//Метод, необходимый для конфигурации модулей. private static void ConfigureModules(string settingFilePath) { MonitorModule = new SystemMonitor(); SenderModule = new ReportSender(); try { var settingDocument = ReadSettingXmlFile(settingFilePath); MonitorModule.GetPerformanceInterval = GetAttributeValueDouble(settingDocument, "monitor_interval", "value"); var serverAddress = Dns.GetHostAddresses(GetElementAttribute(settingDocument, "server_name", "value").Value) .First(ad => ad.AddressFamily == AddressFamily.InterNetwork); var serverPort = GetAttributeValueInt32(settingDocument, "server_port", "value"); SenderModule.ServerEndPoint = new IPEndPoint(serverAddress, serverPort); SenderModule.IntervalAttempts = GetAttributeValueDouble(settingDocument, "interval_attempt", "value"); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Сервер сконфигурирован с настройками по умолчанию."); } }