public override bool HasAllowedSubFolders(FileSystemInfo fsInfo)
 {
     if (fsInfo is SpecialFolderRoot)
         return true;
     else
         return base.HasAllowedSubFolders(fsInfo);
 }
Exemplo n.º 2
0
 public virtual bool HasAllowedSubFolders(FileSystemInfo fsInfo)
 {
     if (!GetRuntimeValue("AllowBrowseFolders"))
         return false;
     
     return fsInfo.HasDirectories;
 }
Exemplo n.º 3
0
 public virtual bool CanDeleteFiles(FileSystemInfo fsInfo)
 {
     if (fsInfo is DrvInfoRoot || fsInfo is FiInfo || null == fsInfo)
         return false;
     return true;
 }
Exemplo n.º 4
0
        public override bool HasAllowedSubFolders(FileSystemInfo fsInfo)
        {
            if ((!(fsInfo is DrvInfoRoot)) && !GetRuntimeValue("AllowBrowseFolders"))
                return false;

            bool result = false;
            foreach (var item in fsInfo.Drives)
            {
                if (IsAllowedDrive(item))
                {
                    result = true;
                    return result;
                }
            }

            foreach (var item in fsInfo.Directories)
            {
                if (AllowShowFolder(item))
                {
                    result = true;
                    return result;
                }
            }

            return result;
        }
Exemplo n.º 5
0
        private void ExpandNode(TreeNode node, FileSystemInfo fsInfo)
        {
            node.Nodes.Clear();
            DefaultableSettings settings = GetCurrentSettings(node);
            if (!settings.HasAllowedSubFolders(fsInfo))
                return;

            foreach (var item in fsInfo.Drives)
            {
                if (settings.AllowShowDrive(item))
                { 
                    TreeNode subNode = node.Nodes.Add(item.Name + item.Label);
                    subNode.Tag = item;

                    int drvImageIndex = CalculateDriveImageIndexTreeView(item);
                    subNode.ImageIndex = drvImageIndex;
                    subNode.SelectedImageIndex = drvImageIndex;

                    if (GetCurrentSettings(subNode).HasAllowedSubFolders(item))
                        subNode.Nodes.Add("?:");
                }
            }

            foreach (var item in fsInfo.Directories)
            {
                if (settings.AllowShowFolder(item))
                { 
                    TreeNode subNode = node.Nodes.Add(item.Name);
                    subNode.Tag = item;
                    subNode.ImageIndex = 12;
                    subNode.SelectedImageIndex = 12;

                    if (GetCurrentSettings(subNode).HasAllowedSubFolders(item))
                        subNode.Nodes.Add("?:");
                }
            }
        }
Exemplo n.º 6
0
        private void ShowCurrentNodeInListView(TreeNode node, FileSystemInfo fsInfo)
        {
            DefaultableSettings settings = GetCurrentSettings(node);
            ListView1.MultiSelect = settings.GetRuntimeValue("AllowMultipleSelect");
            if (settings.GetRuntimeValue("AllowBrowseFolders"))
            {
                foreach (DrvInfo item in fsInfo.Drives)
                {
                    if (settings.AllowShowDrive(item))
                    {
                        ListViewItem viewItem = ListView1.Items.Add(item.Name + item.Label);
                        viewItem.Tag = item;
                        viewItem.ImageIndex = CalculateDriveImageIndexListView(item);
                    }
                }

                foreach (FolderInfo item in fsInfo.Directories)
                {
                    if (settings.AllowShowFolder(item))
                    {
                        ListViewItem viewItem = ListView1.Items.Add(item.Name);
                        viewItem.Tag = item;
                        viewItem.ImageIndex = 1;
                    }
                }
            }

            foreach (FiInfo item in fsInfo.Files)
            {
                if (settings.AllowShowFile(item))
                {
                    ListViewItem viewItem = ListView1.Items.Add(item.Name);
                    viewItem.SubItems.Add(item.ValidatedSize);
                    viewItem.Tag = item;
                    viewItem.ImageIndex = CalculateFileImageIndex(item.Name);
                }
            }

            StripButtonCreateDirectory.Enabled = settings.CanCreateFolders(fsInfo);
            StripButtonDeleteDirectory.Enabled = false;
            StripButtonDeleteFile.Enabled = false;
        }