Example #1
0
        public static void initDiipScan(string root)
        {
            if (__initializedDiipScan)
            {
                return;
            }

            __initializedDiipScan = true;

            if (System.IO.Directory.Exists(root))
            {
                __flatFolders = new List <flatFolder>();
                __diipFolder  = diipScan(root);
            }
            else
            {
                __diipFolder = new folder(root + " was not found!");
            }

            __initializedDiipScan = false;
        }
Example #2
0
        private static folder diipScan(string root)
        {
            folder diipFolder = new folder(root.Split("\\".ToCharArray()).Last());

            string[] subfolders = System.IO.Directory.GetDirectories(root);
            string[] files      = System.IO.Directory.GetFiles(root);

            foreach (string file in files)
            {
                string fileName = file.Split("\\".ToCharArray()).Last();

                if (fileName.ToLower().Equals("description.txt"))
                {
                    diipFolder.folderInfo.description = System.IO.File.ReadAllText(file);
                }
                else if (fileName.ToLower().Equals("header.txt"))
                {
                    diipFolder.folderInfo.header = System.IO.File.ReadAllText(file);
                }
                else if (fileName.ToLower().Equals("hyperlinks.txt"))
                {
                    diipFolder.folderInfo.InitHyperlinks(System.IO.File.ReadAllText(file));
                }
                else if (fileName.ToLower().Equals("meta.txt"))
                {
                    diipFolder.folderInfo.InitMetadata(System.IO.File.ReadAllText(file));
                }

                diipFolder.files.Add(fileName);
            }

            foreach (string subfolder in subfolders)
            {
                diipFolder.subfolders.Add(diipScan(subfolder));
            }

            __flatFolders.Add(new flatFolder(diipFolder));

            return(diipFolder);
        }
 public flatFolder(folder folder)
 {
     this.folder       = folder;
     this.flatMetadata = folder.getFlatMetadata();
 }