Exemplo n.º 1
0
        public void MoveItemForward(int index)
        {
            if (index < 0 || index > Album.Count - 1)
            {
                throw new IndexOutOfRangeException();
            }
            // Remove photo and reinsert at subsequent pos
            Photograph photo = Album[index];

            Album.RemoveAt(index);
            Album.Insert(index + 1, photo);
        }
Exemplo n.º 2
0
        public void MoveItemBackward(int index)
        {
            if (index <= 0 || index >= Album.Count)
            {
                throw new IndexOutOfRangeException();
            }
            // Remove photo and reinsert at prior position
            Photograph photo = Album[index];

            Album.RemoveAt(index);
            Album.Insert(index - 1, photo);
        }
Exemplo n.º 3
0
        static private Photograph ReadPhotoV63(StreamReader sr)
        {
            // Presume at the start of photo
            string file = sr.ReadLine();

            if (file == null || file.Length == 0)
            {
                return(null);
            }

            // File not null, should find photo

            Photograph p = new Photograph(file);

            p.Caption      = sr.ReadLine();
            p.DateTaken    = DateTime.Parse(sr.ReadLine());
            p.Photographer = sr.ReadLine();
            p.Notes        = sr.ReadLine();
            return(p);
        }