public List <ImageGallery> getDataImagesGallery(List <string> images_pat, int n_divs) { List <ImageGallery> data_gallery = new List <ImageGallery> (); int n_rows = images_pat.Count / n_divs; int y = 0; for (; y < n_rows; y++) { ImageGallery row_images = new ImageGallery(); for (int j = 0; j < n_divs; j++) { row_images.new_item(images_pat [y * n_divs + j]); Console.WriteLine(images_pat [y * n_divs + j]); } data_gallery.Add(row_images); } ImageGallery row_im = new ImageGallery(); for (int i = 0; i < images_pat.Count % n_divs; i++) { row_im.new_item(images_pat [n_divs * y + i]); } if (images_pat.Count % n_divs != 0) { data_gallery.Add(row_im); } return(data_gallery); }
public List<ImageGallery> getDataImagesGallery(List<string> images_pat,int n_divs) { List<ImageGallery> data_gallery = new List<ImageGallery> (); int n_rows = images_pat.Count / n_divs; int y = 0; for (; y < n_rows; y++) { ImageGallery row_images = new ImageGallery(); for (int j = 0; j < n_divs; j++) { row_images.new_item (images_pat [y * n_divs + j]); Console.WriteLine (images_pat [y * n_divs + j]); } data_gallery.Add (row_images); } ImageGallery row_im = new ImageGallery(); for (int i = 0; i < images_pat.Count % n_divs; i++) { row_im.new_item (images_pat [n_divs * y + i]); } if (images_pat.Count % n_divs != 0) { data_gallery.Add (row_im); } return data_gallery; }