internal GalleryList GetGalleryList(Model Model) { if (_modelList.Exists(x => x.ModelName == Model.ModelName)) return _modelList.Find(x => x.ModelName == Model.ModelName).ModelGalleries; return null; }
public void SetModelList() { foreach (DirectoryInfo model in workingDirectory.GetDirectories()) if (!Char.IsNumber(Convert.ToChar(model.Name.Substring(0, 1)))) { Model newModel = new Model(); newModel.ModelName = model.Name; newModel.Location = new DirectoryInfo(model.FullName); SetModelGalleries(newModel); _modelList.Add(newModel); } }
private void SetModelGalleries(Model newModel) { FileInfo[] galleries = newModel.Location.GetFiles(); if (galleries.Count() > 0) foreach (FileInfo galleryFile in galleries) { string galleryName = ExtractGalleryName(galleryFile); if (!newModel.ModelGalleries.Exists(x => x.GalleryName == galleryName)) newModel.ModelGalleries.Add(new Gallery(galleryName, galleryFile.Directory)); newModel.ModelGalleries.Find(x => x.GalleryName == galleryName).Files.Add(galleryFile); } }