public void AddFiles(string[] files)
{
// TODO: add more exceptions:
// - unsupported file type
// - file over size limit
bool filesExcluded = false;
foreach (string fileName in files) {
if (!IsSupported(fileName) || !IsInSizeLimits(fileName)) {
filesExcluded = true;
continue;
}
Files.Add(fileName);
}
if (filesExcluded) {
throw new AddPhotosException(
String.Format("Some files weren't added because they exceed either the maximum video file size limit of {0}MB or the maximum photo file size limit of {1}MB",
UploadService.VideoFileSizeLimit,
UploadService.PhotoFileSizeLimit));
}
}