Exemplo n.º 1
0
        public Folder PopulateTreeViewDirectories(string directoryValue, Folder parentNode)
        {
            List<string> directorys = new List<string>();
            var folders = new DirectoryInfo(directoryValue).GetDirectories();

            foreach (var directoryInfo in folders)
            {
                if (!directoryInfo.Attributes.ToString().ToLower().Contains("hidden"))//filter SVN folders (hidden ones)
                    directorys.Add(directoryInfo.FullName);
            }

            try
            {
                if (directorys.Count != 0)
                {
                    foreach (string directory in directorys)
                    {
                        Folder f = new Folder(directory);
                        parentNode.Files.Add(f);
                        PopulateTreeViewFiles(directory, f);
                        PopulateTreeViewDirectories(directory, f);
                    }
                }
            }
            catch
            {
            }
            return parentNode;
        }
Exemplo n.º 2
0
 private void FillFiles(string path, List<Folder> rootTarget)
 {
     Folder rootFolder = new Folder(path);
     PopulateTreeViewFiles(path, rootFolder);
     rootTarget.Add(PopulateTreeViewDirectories(path, rootFolder));
 }
Exemplo n.º 3
0
        private void PopulateTreeViewFiles(string directoryValue, Folder parentNode)
        {
            string[] filesArray = Directory.GetFiles(directoryValue);
            foreach (string file in filesArray)
            {
                if (file.Contains(StaticFields.TEST_EXTENTION))//adds test name to the test list
                    TestListFolder.Add(new Folder(file));
                else if (file.Contains(StaticFields.SCRIPT_EXTENTION))
                    ScriptListFolder.Add(new Folder(file));
                else if (file.Contains(StaticFields.SUITE_EXTENTION))
                    ScriptListFolder.Add(new Folder(file));

                var f = new Folder(file);
                parentNode.Files.Add(f);
            }
        }