Ejemplo n.º 1
0
 private void SetImageSizes(string id, string dimensions, string path = null, bool isDynamic = false)
 {
     if (dimensions != null && dimensions.Contains("*"))
     {
         var splits = dimensions.Split('*');
         if (splits != null && splits.Length > 1)
         {
             int.TryParse(splits[0], out var width);
             int.TryParse(splits[1], out var height);
             var imageSize = new ImageSize()
             {
                 ImageID   = id,
                 ImageName = path,
                 Height    = height,
                 Width     = width,
                 IsDynamic = isDynamic
             };
             ImageSizes.Add(imageSize);
             if (width == 0 || width == 99 || height == 0 || height == 99)
             {
                 ShowImageMessage(id);
             }
         }
         else
         {
             ShowImageMessage(id);
         }
     }
     else
     {
         ShowImageMessage(id);
     }
 }