private Service() { escadronManager = new Repository<EscadronConfiguration>(WebApi.DEFAULT_FILE_PATH); recentFilesManager = new Repository<FichiersRecentsConfiguration>(WebApi.DEFAULT_RECENT_FILES_PATH); data = escadronManager.GetData(); recentFiles = recentFilesManager.GetData(); AddToRecentFiles(); }
public SectionLeaderboard(EscadronConfiguration escadron) { Sections = new List<SectionLeaderboardItem>(); foreach (Section section in escadron.Sections) { SectionLeaderboardItem sectionLeaderboard = new SectionLeaderboardItem(section); Sections.Add(sectionLeaderboard); NbBilletsVendu += sectionLeaderboard.NbBilletsVendu; } NbBilletsDistribue = escadron.NbBilletsCirculation; Sections = Sections.OrderBy(s => s.Nom).ToList(); }
public void FileOpen(string path) { if (!File.Exists(path)) throw new FileNotFoundException(); escadronManager.Dispose(); escadronManager = new Repository<EscadronConfiguration>(path); data = escadronManager.GetData(); AddToRecentFiles(); }
public void FileCreate(string path, string saveName = null) { escadronManager.Dispose(); if (File.Exists(path)) File.Delete(path); escadronManager = new Repository<EscadronConfiguration>(path, true); data = escadronManager.GetData(); if (saveName != null) { data.Nom = saveName; } InitializeGrades(); escadronManager.Save(); AddToRecentFiles(); }