コード例 #1
0
 public ActionResult OpenPicturesFromPhotoesView(string pageName)
 {
     FileInfo[] files = new FileManager().GetFiles("//Content//Examples1//Pictures");
     FileInfo[] currentFiles = files.Take(PicturesFromPhotoesVolume).ToArray();
     TempData["count"] = PicturesFromPhotoesVolume;
     ViewBag.isExhausted = false;
     return PartialView(pageName, currentFiles);
 }
コード例 #2
0
        public ActionResult AppendPicturesFromPhotoesView(string pageName)
        {
            FileInfo[] files = new FileManager().GetFiles("//Content//Examples1//Pictures");
            int index = int.Parse(TempData.Peek("count").ToString());
            TempData["count"] = index + PicturesFromPhotoesVolume;

            if (index >= files.Length - PicturesFromPhotoesVolume) { ViewBag.isExhausted = true; }
            else ViewBag.isExhausted = false;

            int currentVolume = PicturesFromPhotoesVolume;
            if (currentVolume > files.Length + 1 - index) currentVolume = files.Length - index;

            FileInfo[] currentFiles = files.Skip(index).Take(currentVolume).ToArray();
            return PartialView(pageName, currentFiles);
        }