private void ListPhotoData(AlbumNode albumNode) { spbxPhoto.Visible = false; lvAlbumList.Visible = true; ShowingAlbums = false; lvAlbumList.Columns.Add("Caption", 120); lvAlbumList.Columns.Add("Photographer", 100); lvAlbumList.Columns.Add("Taken", 80, HorizontalAlignment.Center); lvAlbumList.Columns.Add("File Name", 200); AlbumManager mgr = albumNode.GetManager(true); if (mgr != null) { foreach (Photograph p in mgr.Album) { ListViewItem item = new ListViewItem(p.Caption, "Photp"); AssignSubItems(item, p); lvAlbumList.Items.Add(item); } } }
private void DisplayTreeNodeProperties() { TreeNode node = atvAlbumTree.SelectedNode; if (node is AlbumNode) { AlbumNode aNode = (AlbumNode)node; AlbumManager mgr = aNode.GetManager(true); if (mgr != null) { DisplayAlbumProperties(mgr); } } else if (node is PhotoNode) { PhotoNode pNode = (PhotoNode)node; DisplayPhotoProperties(pNode.Photograph); } // Preserve and display any changes atvAlbumTree.SaveAlbumChanges(); atvAlbumTree.RefreshNode(); }
private void RenameAlbum(ListViewItem item, string newName) { try { string oldPath = null; string newPath = null; if (item.Tag is AlbumManager) { AlbumManager mgr = (AlbumManager)item.Tag; oldPath = mgr.FullName; mgr.RenameAlbum(newName); newPath = mgr.FullName; } else if (item.Tag is string) { // Presume tag is album path oldPath = (string)item.Tag; newPath = AlbumManager.RenameAlbum( oldPath, newName); item.Tag = newPath; } if (oldPath != null) { // Update the album node AlbumNode aNode = atvAlbumTree.FindAlbumNode(oldPath); if (aNode != null) { aNode.UpdatePath(newPath); } } } catch (ArgumentException aex) { MessageBox.Show("Unable to rename album. [" + aex.Message + "]"); } }
private void CollapseAlbum(AlbumNode node) { node.RemoveChildren(); }