Ejemplo n.º 1
0
        public void Load(string directoryPath)
        {
            if (Directory.Exists(directoryPath) == false)
            {
                throw new DirectoryNotFoundException("Directory Not Found");
            }

            _systemIcons.Clear();
            _imageList.Images.Clear();
            Nodes.Clear();

            Icon folderIcon = new Icon(typeof(FileSystemTreeView), "icons.folder.ico");

            _imageList.Images.Add(folderIcon);
            _systemIcons.Add(FileSystemTreeView.Folder, 0);

            DirectoryNode node = new DirectoryNode(this, new DirectoryInfo(directoryPath));

            node.Expand();
        }
Ejemplo n.º 2
0
        public void Load( string directoryPath )
        {
            if( Directory.Exists( directoryPath ) == false )
            throw new DirectoryNotFoundException( "Directory Not Found" );

             _systemIcons.Clear();
             _imageList.Images.Clear();
             Nodes.Clear();

             Icon folderIcon = new Icon("icons/folder.ico");

             _imageList.Images.Add( folderIcon );
             _systemIcons.Add( FileSystemTreeView.Folder, 0 );

             DirectoryNode node = new DirectoryNode( this, new DirectoryInfo( directoryPath ) );
             node.Expand();
        }