Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 void Load()
 {
     if (File.Exists(settingsFile))
     {
         profilesSettings = s.DeSerializeObject(settingsFile);
     }
     else
     {
         profilesSettings = new OpenVPNManagerSettings();
     }
 }
Exemplo n.º 3
0
 void Load()
 {
     if (File.Exists(settingsFile))
     {
         profilesSettings = s.DeSerializeObject(settingsFile);
     }
     else
         profilesSettings = new OpenVPNManagerSettings();
 }
Exemplo n.º 4
0
 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();            
 }