private EventConfiguration GetEventConfiguration(string path) { EventConfiguration settings = null; try { XmlSerializer serializer = new XmlSerializer(typeof(EventConfiguration)); Stream fs = File.OpenRead(path); settings = (EventConfiguration)serializer.Deserialize(fs); fs.Close(); } catch (Exception ex) { Trace.WriteLine("Failed to load EventConfiguration: " + ex.Message); } return(settings); }
/// <summary> /// SaveEventConfiguration to XML File /// </summary> /// <param name="setting">EventConfiguration Settings to write to disk.</param> public void SaveEventConfiguration(EventConfiguration setting) { string path = GetFullPath(EventConfigurationFileName); SaveXML <EventConfiguration>(setting, path); }