예제 #1
0
        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);
        }
예제 #2
0
파일: Template4.cs 프로젝트: aocsa/CInca
		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;
		}