コード例 #1
0
 public void Load()
 {
     if (_storage.TryRead(StorageKey, out AlexOptions options))
     {
         AlexOptions = options;
     }
 }
コード例 #2
0
 public void Load()
 {
     if (_storage.TryRead(StorageKey, out AlexOptions options))
     {
         AlexOptions = options;
     }
     else
     {
         Log.Warn($"Could not read from storage.");
     }
 }
コード例 #3
0
 public void Load()
 {
     if (!_storage.TryRead <AlexOptions>(StorageKey, out var options))
     {
         // no options file?
         options = new AlexOptions();
         if (!_storage.TryWrite <AlexOptions>(StorageKey, options))
         {
             // uhmmm...
             throw new IOException("Unable to write default AlexOptions!");
         }
     }
 }
コード例 #4
0
 public void Load()
 {
     if (_storage.TryRead(StorageKey, out SavedServerEntry[] newEntries))