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