public static SettingsClass GetInstance() { if (_instance == null) { if (File.Exists(Directory.GetCurrentDirectory() + "\\settings.bin")) { _instance = ReadWriteStructure <SettingsClass> .Load("settings"); } else { _instance = new SettingsClass(); ReadWriteStructure <SettingsClass> .Save(_instance, "settings"); } } return(_instance); }
public static UserClass GetInstance() { if (_instance == null) { if (File.Exists(Directory.GetCurrentDirectory() + "\\user.bin")) { _instance = ReadWriteStructure <UserClass> .Load("user"); } else { _instance = new UserClass(); ReadWriteStructure <UserClass> .Save(_instance, "user"); } } return(_instance); }
public void Save() { ReadWriteStructure <SettingsClass> .Save(_instance, "settings"); }