public void LoadAllChampionsLocal() { if (File.Exists(StaticSerializer.FullPath_AllChampions)) { AllChampions = (ChampionList)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_AllChampions); } else { AllChampions = new ChampionList("AllChamps"); } }
private void LoadSettings() { if (File.Exists(StaticSerializer.FullPath_Settings)) { MySettings = (EcsSettings)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_Settings); } if (MySettings == null) { MySettings = new EcsSettings(); } MySettings.SettingsChanged += (s, args) => StaticSerializer.SerializeObject(MySettings, StaticSerializer.FullPath_Settings); }
private void LoadSerializedGroupManager() { if (File.Exists(StaticSerializer.FullPath_GroupManager)) { MyGroupManager = (StaticGroupManager)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_GroupManager); } if (MyGroupManager == null) { NewGroupManager(); } MyGroupManager.GroupsChanged += (s, args) => StaticSerializer.SerializeObject(MyGroupManager, StaticSerializer.FullPath_GroupManager); for (int i = 0; i < MyGroupManager.GroupCount; i++) { MyGroupManager.getGroup(i).ChampionsChanged += (s, args) => StaticSerializer.SerializeObject(MyGroupManager, StaticSerializer.FullPath_GroupManager); } }