Example #1
0
 public static ConnectionSettings GetSettings()
 {
     if(_instance==null)
     {
         _instance = new ConnectionSettings();
     }
     return _instance;
 }
Example #2
0
 public static void Load(string FileName)
 {
     Filename = FileName;
     try
     {
         FileStream stream = File.Open(FileName, FileMode.Open);
         XmlSerializer serializer = new XmlSerializer(typeof (ConnectionSettings));
         _instance = (ConnectionSettings)serializer.Deserialize(stream);
         stream.Close();
     }
     catch(FileNotFoundException)
     {
         _instance = new ConnectionSettings();
         Save();
     }
     Setup();
 }