Beispiel #1
0
 public static void Initialize()
 {
     if (_instance == null)
     {
         try
         {
             _instance = XMLSerializer.LoadXML<Setting>(settingFilePath, true);
         }
         catch (Exception)
         {
             _instance = new Setting();
         }
         finally
         {
             if (_instance.KernelProperty.KillByErrorCount >= Define.SafeModeThreshold)
                 _isSafeMode = true;
             _instance.KernelProperty.KillByErrorCount++;
             while (afterInitializeInvoke.Count > 0)
                 afterInitializeInvoke.Pop()();
         }
     }
     else
     {
         throw new InvalidOperationException("すでに初期化されています。");
     }
 }
Beispiel #2
0
 public static void Initialize()
 {
     if (_instance == null)
     {
         try
         {
             _instance = XMLSerializer.LoadXML<Setting>(settingFilePath, true);
         }
         catch (Exception)
         {
             _instance = new Setting();
         }
         finally
         {
             while (afterInitializeInvoke.Count > 0)
                 afterInitializeInvoke.Pop()();
         }
     }
     else
     {
         throw new InvalidOperationException("すでに初期化されています。");
     }
 }