Esempio n. 1
0
        /// <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
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Set up pictures for viewing
        /// </summary>
        private void SetUp()
        {
            pictureEnumerator.SetIndex(picture, LIMITS);

            /*foreach (Object pix in pictureEnumerator[LIMITS])
             * {
             *  BootedPictures.Add(new ImageHolder.ImageObject((Picture)pix));
             * }*/

            Picture pict = picture;

            do
            {
                BootedPictures.Add(new ImageObject(pict));
                pict = (Picture)pictureEnumerator.Current;
            }while (pictureEnumerator.MoveNext() && !(BootedPictures.Contains(pict) || BootedPictures.IsFull()));
            BootedPictures.SetIndex(picture);
        }