public void LoadSettingsFromFile() { FileStream fs; try { fs = new FileStream(settingsFilePath, FileMode.Open); } catch (System.IO.FileNotFoundException) { return; } catch (System.IO.DirectoryNotFoundException) { return; } XmlSerializer ser = new XmlSerializer(typeof(Settings)); singleton = (Settings)ser.Deserialize(fs); fs.Flush(); fs.Close(); fs.Dispose(); }
public static Settings GetInstance() { if(singleton == null) { singleton = new Settings(); } return singleton; }