public static ProfileHandler GetInstance() { if (instance == null) { instance = new ProfileHandler(); } return instance; }
public void LoadProfilesFromFile() { FileStream fs; try { fs = new FileStream(profilesFilePath, FileMode.Open); } catch (System.IO.FileNotFoundException) { return; } XmlSerializer ser = new XmlSerializer(typeof(ProfileHandler)); instance = (ProfileHandler)ser.Deserialize(fs); fs.Flush(); fs.Close(); fs.Dispose(); }