public void SerializeObject(string filename, OpenVPNManagerSettings objectToSerialize) { Stream stream = File.Open(filename, FileMode.Create); XmlSerializer x = new XmlSerializer(objectToSerialize.GetType()); x.Serialize(stream, objectToSerialize); stream.Close(); }
void Load() { if (File.Exists(settingsFile)) { profilesSettings = s.DeSerializeObject(settingsFile); } else { profilesSettings = new OpenVPNManagerSettings(); } }
void Load() { if (File.Exists(settingsFile)) { profilesSettings = s.DeSerializeObject(settingsFile); } else profilesSettings = new OpenVPNManagerSettings(); }