/// <summary>
        /// Setup the loader for viewing.
        /// </summary>
        private void SetUp()
        {
            int extent = capacity / 2;

            currentImage = pictureEnumerator.Current as Picture;
            lock (this)
            {
                pictureEnumerator.MoveNext(extent);
                for (int i = 0; i < capacity; i++)
                {
                    pictureEnumerator.MovePrevious();
                    ImageObject io = new ImageObject(pictureEnumerator.Current as Picture);
                    if (io.Valid)
                    {
                        this[pictureEnumerator.Current as Picture] = io;
                    }
                }

                #region commentedOut...

                /*
                 * for (int i = 0; i < extent; i++)
                 * {
                 *  pictureEnumerator.MovePrevious();
                 *  ImageObject io = new ImageObject(pictureEnumerator.Current as Picture);
                 *  if (io.Valid)
                 *  {
                 *      this[pictureEnumerator.Current as Picture] = io;
                 *  }
                 * }
                 * pictureEnumerator.SetIndex(currentImage);
                 * for (int i = 0; i < extent; i++)
                 * {
                 *  pictureEnumerator.MoveNext();
                 *  ImageObject io = new ImageObject(pictureEnumerator.Current as Picture);
                 *  if (io.Valid)
                 *  {
                 *      this[pictureEnumerator.Current as Picture] = io;
                 *  }
                 * }
                 * pictureEnumerator.SetIndex(currentImage);
                 *
                 * ImageObject cur_io = new ImageObject(pictureEnumerator.Current as Picture);
                 * if (cur_io.Valid)
                 * {
                 *  this[pictureEnumerator.Current as Picture] = cur_io;
                 * }
                 */
                #endregion
            }
        }
Exemple #2
0
        /// <summary>
        /// Get the previous image viewed.
        /// </summary>
        /// <returns></returns>
        public System.Drawing.Image GetPreviousImage()
        {
            currentImage = BootedPictures.Current;
            if (BootedPictures.Count > 1)
            {
                while (pictureEnumerator.MovePrevious() && currentImage != null && currentImage.Equals(pictureEnumerator.Current))
                {
                    ;
                }
                BootedPictures.AddNext((Picture)pictureEnumerator.Current);
            }
            return(currentImage.Image);

            /*
             * if (pictureEnumerator.MovePrevious())
             * {
             *  currentImage = BootedPictures.Current;
             *  Picture p = new Picture(BootedPictures.Current.Name);
             *  BootedPictures.AddNext(pictureEnumerator.GetIndex(p, LIMITS));
             *  return currentImage.Image;
             * }
             * return null;*/
        }