public void GenerateNames() { Studies = Studies.OrderBy(s => s.ID).ToList(); var i = 1; foreach (var s in Studies) { StudyDictionary.Add(s.ID, string.Format("{0}_{1}", "Study", i)); i++; } }
public void GenerateNamesByType() { var types = Enum.GetValues(typeof(DICOMFileType)).Cast <DICOMFileType>(); foreach (var type in types) { var studiesOfType = Studies .Where(s => s.Type == type) .OrderBy(s => s.Date) .ToList(); var abbreviation = GetTypeAbbreviation(type); var i = 1; foreach (var s in studiesOfType) { StudyDictionary.Add(s.ID, string.Format("{0}_{1}", abbreviation, i)); i++; } } }