Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.txtTitle.Text != string.Empty)
            {
                Photo newPhoto = new Photo(this.pbPhoto.Image);
                newPhoto.vtitle       = this.txtTitle.Text;
                newPhoto.vauthor      = this.txtAuthor.Text;
                newPhoto.vdescription = this.txtDescription.Text;
                newPhoto.vimagepath   = this.pathToPhoto;
                newPhoto.valbumid     = parentGallery.GetSelectedAlbumIcon().AlbumObject.vid;

                parentGallery.GetSelectedAlbumIcon().AlbumObject.AddPhoto(newPhoto);
                parentGallery.RefreshPhotosView();
                this.Close();
            }
            else
            {
                MessageBox.Show("Podaj tytuł zdjęcia!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }