public AlbumDirectoryNode AddAlbumDirectory(string name, string albumDir)
        {
            AlbumDirectoryNode node = new AlbumDirectoryNode(name, albumDir);

            this.Nodes.Add(node);
            return(node);
        }
Ejemplo n.º 2
0
        private void ListAlbumData(AlbumDirectoryNode dirNode)
        {
            // Show albums in list view
            spbxPhoto.Visible   = false;
            lvAlbumList.Visible = true;
            ShowingAlbums       = true;

            // Presume list cleared, so recreate columns
            lvAlbumList.Columns.Add("Name", 80);
            lvAlbumList.Columns.Add("Title", 120);
            lvAlbumList.Columns.Add("Size", 40, HorizontalAlignment.Center);

            // Assign Tile size
            int h = Font.Height;

            lvAlbumList.TileSize = new Size(
                150, h * lvAlbumList.Columns.Count + h / 3);

            // Add the albums for given node
            foreach (AlbumNode aNode in dirNode.AlbumNodes)
            {
                string       text = Path.GetFileNameWithoutExtension(aNode.AlbumPath);
                ListViewItem item = lvAlbumList.Items.Add(text);

                AlbumManager mgr = aNode.GetManager(false);
                item.ImageKey = aNode.ImageKey;
                AssignSubItems(item, aNode.AlbumPath, mgr);
            }
        }
 private void ExpandAlbumDirectory(AlbumDirectoryNode node)
 {
     BeginUpdate();
     try
     {
         node.CreateAlbumNodes();
     }
     finally { EndUpdate(); }
 }
        public AlbumDirectoryNode AddAlbumDirectory(string name, string albumDir)
        {
            // Create a new top-level node
            AlbumDirectoryNode node = new AlbumDirectoryNode(name, albumDir);

            this.Nodes.Add(node);

            return(node);
        }
 public void SelectChild(AlbumDirectoryNode node, string albumPath)
 {
     foreach (TreeNode n in node.Nodes)
     {
         AlbumNode aNode = n as AlbumNode;
         if (aNode != null && String.Equals(aNode.AlbumPath, albumPath, StringComparison.InvariantCultureIgnoreCase))
         {
             SelectedNode = n;
             break;
         }
     }
 }
Ejemplo n.º 6
0
 private void ExpandAlbumDirectory(AlbumDirectoryNode node)
 {
     // Add a node per album
     BeginUpdate();
     try
     {
         // Make sure the album nodes exist
         node.CreateAlbumNodes();
     }
     finally
     {
         EndUpdate();
     }
 }
        internal AlbumNode FindAlbumNode(string path)
        {
            AlbumDirectoryNode dirNode = SelectedNode as AlbumDirectoryNode;

            if (dirNode != null)
            {
                foreach (AlbumNode node in dirNode.AlbumNodes)
                {
                    if (string.Equals(node.AlbumPath, path, StringComparison.InvariantCultureIgnoreCase))
                    {
                        return(node);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 8
0
        private void ListAlbumData(AlbumDirectoryNode dirNode)
        {
            spbxPhoto.Visible   = false;
            lvAlbumList.Visible = true;
            ShowingAlbums       = true;

            lvAlbumList.Columns.Add("Name", 80);
            lvAlbumList.Columns.Add("Title", 120);
            lvAlbumList.Columns.Add("Size", 40, HorizontalAlignment.Center);

            foreach (AlbumNode aNode in dirNode.AlbumNodes)
            {
                string       text = Path.GetFileNameWithoutExtension(aNode.AlbumPath);
                ListViewItem item = lvAlbumList.Items.Add(text);

                AlbumManager mgr = aNode.GetManager(false);
                item.ImageKey = aNode.ImageKey;
                AssignSubItems(item, aNode.AlbumPath, mgr);
            }
        }