Esempio n. 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);
 }
Esempio n. 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);
 }