Could you help me to solve some problem, please?
I want to get one of the ImageFormat properties (like ImageFormat.Png or ImageFormat.Jpeg, etc). And I need it dynamically. The method should look like (as I see it):
private List<ImageFormat> GetValidImageFormats()
{
List<ImageFormat> result = new List<ImageFormat>()
foreach (string extension in ValidExtensions)
{
// do some expression magic
}
}
I have problem with with code in foreach. I dont even sure of using Expression Trees.
I need it for my custom validator for uploaded image files. Any help is just great. +1 for any relevant solution.
EDIT: Possible values of ValidExtensions = new[] {"jpg", "png", "jpeg", "bmp", "gif", "icon"}
Aucun commentaire:
Enregistrer un commentaire