예제 #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();
        }
예제 #2
0
 void Load()
 {
     if (File.Exists(settingsFile))
     {
         profilesSettings = s.DeSerializeObject(settingsFile);
     }
     else
     {
         profilesSettings = new OpenVPNManagerSettings();
     }
 }
예제 #3
0
 void Load()
 {
     if (File.Exists(settingsFile))
     {
         profilesSettings = s.DeSerializeObject(settingsFile);
     }
     else
         profilesSettings = new OpenVPNManagerSettings();
 }
예제 #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();            
 }