예제 #1
0
        private void SearchDirs(string path1, string path2)
        {
            var allDirs = MixStringList(Directory.GetDirectories(path1), Directory.GetDirectories(path2));

            foreach (string subDir in allDirs)
            {
                var gt = new GroupTitle();
                gt.VerticalAlignment = VerticalAlignment.Top;
                gt.Height            = 64;
                gt.Info.Text         = FileHelper.GetSaftyFileName(subDir, true);
                if (Directory.GetFiles(subDir).Length != 0)
                {
                    ProgramList.Children.Add(gt);
                }

                BringFiles(Directory.GetFiles(subDir));
            }
        }
예제 #2
0
        private void SearchFiles(string path1, string path2)
        {
            var gta = new GroupTitle();

            gta.VerticalAlignment = VerticalAlignment.Top;
            gta.Height            = 64;
            gta.Info.Text         = "#";
            ProgramList.Children.Add(gta);
            var lista      = MixStringList(Directory.GetFiles(path1), Directory.GetFiles(path2));
            var lista_real = new List <string>();

            foreach (string suba in lista)
            {
                switch (FileHelper.GetSaftyFileName(suba, false).Substring(0, 1).ToLower())
                {
                case "a":
                case "b":
                case "c":
                case "d":
                case "e":
                case "f":
                case "g":
                case "h":
                case "i":
                case "j":
                case "k":
                case "l":
                case "m":
                case "n":
                case "o":
                case "p":
                case "q":
                case "r":
                case "s":
                case "t":
                case "u":
                case "v":
                case "w":
                case "x":
                case "y":
                case "z":
                    break;

                default:
                    lista_real.Add(suba);
                    break;
                }
            }
            BringFiles(lista_real.ToArray());

            var letters = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };

            foreach (string subLetter in letters)
            {
                var gt = new GroupTitle();
                gt.VerticalAlignment = VerticalAlignment.Top;
                gt.Height            = 64;
                gt.Info.Text         = subLetter.ToUpper();
                ProgramList.Children.Add(gt);

                BringFiles(MixStringList(Directory.GetFiles(path1, subLetter + "*"), Directory.GetFiles(path2, subLetter + "*")).ToArray());
            }
        }