コード例 #1
0
 // Add some word here to spesify it's a singelton ?
 public static AppConfigService GetInstance()
 {
     if (AppConf == null)
     {
         lock (sr_InstanceLock)
         {
             if (AppConf == null)
             {
                 try
                 {
                     AppConf = SerializerService.LoadFromFile <AppConfigService>(
                         k_FilePath,
                         typeof(AppConfigService));
                 }
                 catch (Exception)
                 {
                     AppConf = new AppConfigService {
                         StateSettings = new StateSettings()
                     };
                 }
             }
         }
     }
     return(AppConf);
 }
コード例 #2
0
 public static void SaveToFile()
 {
     SerializerService.SaveToFile(k_FilePath, GetInstance());
 }