Ejemplo n.º 1
0
 public override void Load()
 {
     if (File.Exists(FileName))
     {
         XDocument xDocument;
         try
         {
             xDocument = XDocument.Load(FileName);
         }
         catch (Exception)//>>说明文件被破坏
         {
             File.Delete(FileName);
             return;
         }
         ((IXSerializable)this).DeSerialize(xDocument.Root);
     }
     SettingsInitialized?.Invoke(this, new EventArgs());
 }
Ejemplo n.º 2
0
 internal void When(SettingsInitialized @event)
 => Settings = new Settings(@event.Players, @event.RoundLimit, @event.FogOfWar);