public void DeleteAlbum(Album album) { if (this.Albums != null) { this.Albums.Remove(album); } }
public void AddAlbum(Album album) { if (this.Albums == null) { this.Albums = new List<Album>(); } this.Albums.Add(album); }
private void btnAdd_Click(object sender, EventArgs e) { Album newAlbum = new Album(this.txtTitle.Text, this.txtDescription.Text, this.txtAuthor.Text); newAlbum.MainImage = this.pbMainPhoto.Image; Photo newPhoto = new Photo(this.pbMainPhoto.Image); newAlbum.AddPhoto(newPhoto); parentGallery.GalleryObject.AddAlbum(newAlbum); parentGallery.GalleryObject = this.parentGallery.GalleryObject; this.Close(); }
private void btnAdd_Click(object sender, EventArgs e) { if (this.txtTitle.Text != string.Empty) { Album newAlbum = new Album(this.txtTitle.Text, this.txtDescription.Text, this.txtAuthor.Text); newAlbum.vmainimage = this.pbMainPhoto.Image; newAlbum.vmainimagepath = this.pathToImage; parentGallery.GalleryObject.AddAlbum(newAlbum); parentGallery.RefreshAlbumsView(); this.Close(); } else { MessageBox.Show("Podaj tytuł albumu!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public bool SavePhotoToAlbum(Album album, Photo photo) { throw new System.Exception("Not implemented"); }
/// <summary> /// Method to delete album /// </summary> /// <param name="album">Album object to delete from album's collection</param> public void DeleteAlbum(Album album) { if (this.Albums != null) { this.Albums.Remove(album); DbService.Delete<Album>(album); } }
/// <summary> /// Dodaje zdjêcie do danego albumu i zapisuje na dysku /// </summary> public bool SavePhotoToAlbum(Album album, Photo photo) { FileAdapter<Album> adapter = new FileAdapter<Album>(); return true; }