internal static int GetNumPhotos(Event ev) { if (string.IsNullOrEmpty(ev.EventFolder)) { throw new ArgumentNullException("Folder name is empty."); } // Get number of photos that belong to the event return(PagingFileUtils.GetNumFiles(ev.EventFolder, GetImageExts())); }
internal static int GetNumUnclaimedPhotos(Event ev) { if (string.IsNullOrEmpty(ev.EventFolder)) { throw new ArgumentNullException("Folder name is empty."); } // Get number of unclaimed photos belong to the event string folder = (ev.EventFolder.EndsWith(Path.DirectorySeparatorChar.ToString()) ? ev.EventFolder : (ev.EventFolder + Path.DirectorySeparatorChar)) + Constants.STR_UNCLAIMED; try { return(PagingFileUtils.GetNumFiles(folder, GetImageExts())); } catch (DirectoryNotFoundException) { return(0); } }