private void tagTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //if (defaultNodeBeingSelected) return;
            // Raise the FolderSelected event so that any sub controls that need to
            // display files (listview for example) can do so.
            if (tagLibrary != null)
            {
                FileEntryInformation entryInfo = (e.Node.Tag as FileEntryInformation);
                if (entryInfo != null)
                {
                    if (entryInfo.FileType == FileEntryType.Folder)
                    {
                        string[] files = tagLibrary.GetFileList(entryInfo.FullPath);
                        if (FolderSelected != null)
                        {
                            FolderSelected(new FolderSelectedEventArgs(files, entryInfo.FullPath));
                        }
                    }

                    if (NodeSelected != null)
                    {
                        if (!IgnoreNodeSelectionEvents)
                        {
                            NodeSelected(sender, e);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public void SetCurrentDirectory(string path)
        {
            string[] folders = tagLibrary.GetFolderList(path);
            string[] files   = tagLibrary.GetFileList(path, this.filter);

            this.tagList.Clear();
            this.tagList.Columns.Clear();
            this.tagList.Columns.AddRange(
                new ColumnHeader[] { this.columnHeader1 });
            tagList.Columns[0].Width = tagList.Width;

            // TODO: Look at making these methods return empty string arrays, rather than null.
            if (folders != null)
            {
                foreach (string folder in folders)
                {
                    CreateFolder(folder);
                }
            }

            if (files != null)
            {
                foreach (string file in files)
                {
                    CreateFile(file);
                }
            }
        }