public bool ReadWaveInfo(string filename) { try { using (StreamReader reader = new StreamReader(filename)) { waveInfo = (WaveInfo) new XmlSerializer(typeof(WaveInfo)).Deserialize(reader.BaseStream); } return(true); } catch (Exception e) { // If we've caught an exception, output an error message // describing the error Console.WriteLine("ERROR: XML File could not be deserialized!"); Console.WriteLine("Exception Message: " + e.Message); return(false); } }
public WaveInfo ReadXML(string filename, int i = 0) { WaveInfo waveInfo; try { using (StreamReader reader = new StreamReader(filename)) { return(waveInfo = (WaveInfo) new XmlSerializer(typeof(WaveInfo)).Deserialize(reader.BaseStream)); } } catch (Exception e) { // If we've caught an exception, output an error message // describing the error Console.WriteLine("ERROR: XML File could not be deserialized!"); Console.WriteLine("Exception Message: " + e.Message); return(null); } }
// Constructor public Loader() { waveInfo = new WaveInfo(); environmentInfo = new EnvironmentInfo(); leaderBoard = new LeaderBoard(); }