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()); }
internal void When(SettingsInitialized @event) => Settings = new Settings(@event.Players, @event.RoundLimit, @event.FogOfWar);