Exemple #1
0
 public void LoadDirectory()
 {
     foreach (DirectoryInfo directoryInfo in DirectoryInfo.GetDirectories())
     {
         DirectoryNode dn = new DirectoryNode(this, directoryInfo);
         dn.ContextMenuStrip =  this.TreeView.DirectoryContextMenuStrip;
     }
 }
Exemple #2
0
        public FileNode(DirectoryNode directoryNode, FileInfo fileInfo)
            : base(fileInfo.Name)
        {
            this._directoryNode = directoryNode;
            this._fileInfo = fileInfo;

            this.ImageIndex = ((FileSystemTreeView)_directoryNode.TreeView).GetIconImageIndex(_fileInfo.FullName);
            this.SelectedImageIndex = this.ImageIndex;

            _directoryNode.Nodes.Add(this);
        }
Exemple #3
0
        public DirectoryNode(DirectoryNode parent, DirectoryInfo directoryInfo)
            : base(directoryInfo.Name)
        {
            this._directoryInfo = directoryInfo;

            parent.Nodes.Add(this);
            Icon icon = ShellIcon.GetSmallIcon(directoryInfo.FullName);
            this.ImageIndex = TreeView.GetIconImageIndex(icon);
            this.SelectedImageIndex = this.ImageIndex;
            Virtualize();
        }
Exemple #4
0
        private void GetLogicalDisk()
        {
            LogicalDiskInfo[] _disks = LogicalDisk.GetLogicalDisks();

            foreach (LogicalDiskInfo _disk in _disks)
            {
                int len = this.Nodes.Count;
                DirectoryInfo di = GetRoot(new DirectoryInfo(_disk.Name));
                DirectoryNode _newItem = new DirectoryNode(this, di);
                _newItem.ContextMenuStrip = DirectoryContextMenuStrip;

            }
        }