示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 public void Save()
 {
     ReadWriteStructure <SettingsClass> .Save(_instance, "settings");
 }