示例#1
0
        private File[] ConvertAsFiles(string[] FileElements)
        {
            File[] DataFiles = new File[FileElements.Length];
            int    index     = 0;

            foreach (string _file in FileElements)
            {
                DataFiles[index]          = new File();
                DataFiles[index].Name     = FileSystemHelperClass.GetAbsoluteName(_file);
                DataFiles[index].UniqueID = FileCount;
                AllFiles.Add(FileCount, _file);
                ++FileCount;
                ++index;
            }
            return(DataFiles);
        }
示例#2
0
        private void GetSubDirectories(string RootDir, Directory DirElem)
        {
            DirElem.Name = FileSystemHelperClass.GetAbsoluteName(RootDir);
            FileSystemHelperClass Helper = new FileSystemHelperClass();

            string[] DirFiles     = io.Directory.GetFiles(RootDir);
            File[]   FileElements = ConvertAsFiles(DirFiles);
            FileSystemHelperClass.AddRange(FileElements, DirElem.Files);
            Directories Dirs = DirElem.Directories;

            foreach (string Folder in io.Directory.GetDirectories(RootDir))
            {
                Directory FolderElem = new Directory();
                GetSubDirectories(Folder, FolderElem);
                Dirs.Add(FolderElem);
            }
        }