public CustomSettings ReadXml() { if (File.Exists(Fields.XMLFileName)) { XmlSerializer ser = new XmlSerializer(typeof(CustomSettings)); TextReader reader = new StreamReader(Fields.XMLFileName); try { Fields = ser.Deserialize(reader) as CustomSettings; } catch (Exception e) { Console.WriteLine(e); Console.WriteLine("-----------------------------"); Console.WriteLine("Warning : Default settings loaded"); } finally { reader.Close(); } } else { WriteXml(); } return(Fields); }
public DatagramReceiver(CustomSettings settings, DatagramCollector datagramCollector) { _settings = settings; _datagramCollector = datagramCollector; }
public SettingsLoader() { Fields = new CustomSettings(); }
public DatagramSender(CustomSettings settings, DatagramGenerator datagramGenerator) { _settings = settings; _datagramGenerator = datagramGenerator; }