Inheritance: System.Windows.Forms.UserControl
コード例 #1
0
        private void LoadPhotos(Album album)
        {
            List <Photo> photosToLoad = album.Photos;

            //remove all PhotoIcon objects
            foreach (Control ctrl in this.panelPhotos.Controls)
            {
                if (ctrl is PhotoIcon)
                {
                    this.panelPhotos.Controls.Remove(ctrl);
                }
            }

            int nextPhotoLocation = leftMargin;

            //create new PhotoIcon objects with photos from selected Album

            foreach (Photo pht in photosToLoad)
            {
                PhotoIcon photo = new PhotoIcon();
                photo.Size        = new Size(widthPhotoObject, heightPhotoObject);
                photo.Location    = new Point(nextPhotoLocation, topMargin);
                photo.Visible     = true;
                photo.PhotoObject = pht;
                photo.PhotoClick += new PhotoIcon.PhotoIconClick(photo_Click);

                this.panelPhotos.Controls.Add(photo);

                nextPhotoLocation += widthPhotoObject + leftMargin;
            }
        }
コード例 #2
0
ファイル: frmPhotoEdit.cs プロジェクト: mnarowski/inzynieria
        public frmPhotoEdit(PhotoIcon photoToEdit, PhotoGallery parentGallery)
        {
            InitializeComponent();

            this.photo = photoToEdit;
            this.parentPhotoGallery = parentGallery;

            this.txtTitle.Text = photoToEdit.PhotoObject.vtitle;
            this.txtDescription.Text = photoToEdit.PhotoObject.vdescription;
            this.txtAuthor.Text = photoToEdit.PhotoObject.vauthor;
            this.pbPhoto.Image = photoToEdit.PhotoObject.vimageobject;
        }
コード例 #3
0
        void photo_Click(object sender, EventArgs e)
        {
            PhotoIcon photoIco = ((PhotoIcon)sender);

            this.txtAuthor.Visible = false;
            this.txtDate.Visible   = false;
            this.MainPicture.Image = photoIco.PhotoObject.vimageobject;
            this.txtAuthor.Text    = photoIco.PhotoObject.vauthor;
            this.txtTitle.Text     = photoIco.PhotoObject.vtitle;
            this.txtAuthor.Visible = true;
            this.txtDate.Visible   = true;
            this.txtDate.Text      = photoIco.PhotoObject.vdateadded;
        }
コード例 #4
0
        void photo_Click(object sender, EventArgs e)
        {
            PhotoIcon photoIco = ((PhotoIcon)sender);

            this.pictureNotes.Visible = false;
            this.txtAuthor.Visible    = false;
            this.txtDate.Visible      = false;
            this.MainPicture.Image    = photoIco.PhotoObject.Image;
            this.pictureNotes.Visible = true;
            this.txtAuthor.Text       = photoIco.PhotoObject.Author;
            this.txtTitle.Text        = photoIco.PhotoObject.Title;
            this.txtAuthor.Visible    = true;
            this.txtDate.Visible      = true;
            this.txtDate.Text         = photoIco.PhotoObject.DateAdded.ToShortDateString();
        }
コード例 #5
0
        public void LoadPhotos(Album album)
        {
            //remove all PhotoIcon objects
            foreach (Control ctrl in this.panelPhotos.Controls)
            {
                if (ctrl is PhotoIcon)
                {
                    this.panelPhotos.Controls.Remove(ctrl);
                }
            }

            this.MainPicture.Image = null;
            this.txtAuthor.Text    = string.Empty;
            this.txtTitle.Text     = string.Empty;
            this.txtDate.Text      = string.Empty;

            if (album != null)
            {
                List <Photo> photosToLoad = album.vphotos;

                this.panelPhotos.AutoScrollPosition = new Point(0, 0);

                int nextPhotoLocation = leftMargin;

                //create new PhotoIcon objects with photos from selected Album

                foreach (Photo pht in photosToLoad)
                {
                    PhotoIcon photo = new PhotoIcon();
                    photo.Size             = new Size(widthPhotoObject, heightPhotoObject);
                    photo.Location         = new Point(nextPhotoLocation, topMargin);
                    photo.PhotoClick      += new PhotoIcon.PhotoIconClick(photo_Click);
                    photo.ContextMenuStrip = this.cmPhoto;
                    photo.PhotoObject      = pht;

                    this.panelPhotos.Controls.Add(photo);

                    nextPhotoLocation += widthPhotoObject + leftMargin;
                }
            }
        }
コード例 #6
0
ファイル: PhotoGallery.cs プロジェクト: mnarowski/inzynieria
        public void LoadPhotos(Album album)
        {
            //remove all PhotoIcon objects
            foreach (Control ctrl in this.panelPhotos.Controls)
            {
                if (ctrl is PhotoIcon)
                {
                    this.panelPhotos.Controls.Remove(ctrl);
                }
            }

            this.MainPicture.Image = null;
            this.txtAuthor.Text = string.Empty;
            this.txtTitle.Text = string.Empty;
            this.txtDate.Text = string.Empty;

            if (album != null)
            {
                List<Photo> photosToLoad = album.vphotos;

                this.panelPhotos.AutoScrollPosition = new Point(0, 0);

                int nextPhotoLocation = leftMargin;

                //create new PhotoIcon objects with photos from selected Album

                foreach (Photo pht in photosToLoad)
                {
                    PhotoIcon photo = new PhotoIcon();
                    photo.Size = new Size(widthPhotoObject, heightPhotoObject);
                    photo.Location = new Point(nextPhotoLocation, topMargin);
                    photo.PhotoClick += new PhotoIcon.PhotoIconClick(photo_Click);
                    photo.ContextMenuStrip = this.cmPhoto;
                    photo.PhotoObject = pht;

                    this.panelPhotos.Controls.Add(photo);

                    nextPhotoLocation += widthPhotoObject + leftMargin;
                }
            }
        }
コード例 #7
0
        private void LoadPhotos(Album album)
        {
            List<Photo> photosToLoad = album.Photos;

            //remove all PhotoIcon objects
            foreach (Control ctrl in this.panelPhotos.Controls)
            {
                if (ctrl is PhotoIcon)
                {
                    this.panelPhotos.Controls.Remove(ctrl);
                }
            }

            int nextPhotoLocation = leftMargin;

            //create new PhotoIcon objects with photos from selected Album

            foreach (Photo pht in photosToLoad)
            {
                PhotoIcon photo= new PhotoIcon();
                photo.Size = new Size(widthPhotoObject, heightPhotoObject);
                photo.Location = new Point(nextPhotoLocation, topMargin);
                photo.Visible = true;
                photo.PhotoObject = pht;
                photo.PhotoClick += new PhotoIcon.PhotoIconClick(photo_Click);

                this.panelPhotos.Controls.Add(photo);

                nextPhotoLocation += widthPhotoObject + leftMargin;
            }
        }