public override void loadInit() { base.loadInit(); this.root = this.comp.files.root.searchForFolder("MsgBoard"); this.missionFolder = this.root.searchForFolder("listings"); this.closedMissionsFolder = this.root.searchForFolder("closed"); if (this.closedMissionsFolder == null) { this.closedMissionsFolder = new Folder("closed"); this.root.folders.Add(this.closedMissionsFolder); } int num; if (!this.missionAssigner) { for (int index = 0; index < this.missionFolder.files.Count; ++index) { try { string str = this.missionFolder.files[index].name.Replace("_", " "); string data = this.missionFolder.files[index].data; this.missions.Add(new ActiveMission((List <MisisonGoal>)null, (string)null, new MailServer.EMailData()) { postingTitle = str, postingBody = data }); } catch (Exception ex) { num = 0 + 1; } } } else { List <ActiveMission> branchMissions = this.os.branchMissions; for (int index = 0; index < this.missionFolder.files.Count; ++index) { try { string data = this.missionFolder.files[index].data; int contractRegistryNumber = 0; this.os.branchMissions.Clear(); ActiveMission activeMission = (ActiveMission)MissionSerializer.restoreMissionFromFile(data, out contractRegistryNumber); List <ActiveMission> activeMissionList = new List <ActiveMission>(); activeMissionList.AddRange((IEnumerable <ActiveMission>) this.os.branchMissions.ToArray()); this.branchMissions.Add(activeMissionList); this.missions.Add(activeMission); } catch (Exception ex) { num = 0 + 1; } } this.os.branchMissions = branchMissions; } }
public override void loadInit() { base.loadInit(); root = comp.files.root.searchForFolder("MsgBoard"); missionFolder = root.searchForFolder("listings"); closedMissionsFolder = root.searchForFolder("closed"); if (closedMissionsFolder == null) { closedMissionsFolder = new Folder("closed"); root.folders.Add(closedMissionsFolder); } if (!missionAssigner) { for (var index = 0; index < missionFolder.files.Count; ++index) { try { var str1 = missionFolder.files[index].name.Replace("_", " "); var str2 = missionFolder.files[index].data; missions.Add(new ActiveMission(null, null, new MailServer.EMailData()) { postingTitle = str1, postingBody = str2 }); } catch (Exception ex) { var num = 0 + 1; } } } else { var list1 = os.branchMissions; for (var index = 0; index < missionFolder.files.Count; ++index) { try { var data = missionFolder.files[index].data; var contractRegistryNumber = 0; os.branchMissions.Clear(); var activeMission = (ActiveMission)MissionSerializer.restoreMissionFromFile(data, out contractRegistryNumber); var list2 = new List <ActiveMission>(); list2.AddRange(os.branchMissions.ToArray()); branchMissions.Add(list2); missions.Add(activeMission); } catch (Exception ex) { var num = 0 + 1; } } os.branchMissions = list1; } }
private void loadListingMissionsFromFiles() { for (int index = 0; index < this.listingsFolder.files.Count; ++index) { string data = this.listingsFolder.files[index].data; string stringForContractFile = this.getIDStringForContractFile(this.listingsFolder.files[index]); try { this.listingMissions.Add(stringForContractFile, (ActiveMission)MissionSerializer.restoreMissionFromFile(data, out this.contractRegistryNumber)); } catch (FormatException ex) { } } }
private void loadListingMissionsFromFiles() { for (var index = 0; index < listingsFolder.files.Count; ++index) { var data = listingsFolder.files[index].data; var stringForContractFile = getIDStringForContractFile(listingsFolder.files[index]); try { listingMissions.Add(stringForContractFile, (ActiveMission)MissionSerializer.restoreMissionFromFile(data, out contractRegistryNumber)); } catch (FormatException ex) { } } }