Beispiel #1
0
        private List <CustomFile> getZipFiles()
        {
            List <CustomFile> allZipFiles = new List <CustomFile>();

            string[]   zipFiles = Directory.GetFiles(RootDirectory, "*.zip", SearchOption.AllDirectories);
            CustomFile result;

            foreach (string entry in zipFiles)
            {
                result = new CustomFile();
                int    length       = entry.Length;
                string numberString = "";
                for (int i = length - 1; i != 0; i--)
                {
                    if (char.IsDigit(entry[i]))
                    {
                        numberString = entry[i] + numberString;
                    }
                    if ((!string.IsNullOrEmpty(numberString) && !char.IsDigit(entry[i])) || entry[i] == '\\')
                    {
                        break;
                    }
                }
                if (string.IsNullOrEmpty(numberString))
                {
                    numberString = "-1";
                }
                result.Priority = int.Parse(numberString);
                result.Name     = entry;
                allZipFiles.Add(result);
            }
            return(allZipFiles);
        }
Beispiel #2
0
        private List <CustomFile> getFileListFromImageList(List <Image> currentPictures)
        {
            List <CustomFile> results = new List <CustomFile>();
            CustomFile        result;

            foreach (Image entry in currentPictures)
            {
                result          = new CustomFile();
                result.Name     = entry.Name.FullName;
                result.Priority = entry.Priority;
                results.Add(result);
            }
            return(results);
        }
 private List<CustomFile> getZipFiles()
 {
     List<CustomFile> allZipFiles = new List<CustomFile>();
     string[] zipFiles = Directory.GetFiles(RootDirectory, "*.zip", SearchOption.AllDirectories);
     CustomFile result;
     foreach (string entry in zipFiles)
     {
         result = new CustomFile();
         int length = entry.Length;
         string numberString = "";
         for (int i = length - 1; i != 0; i--)
         {
             if (char.IsDigit(entry[i]))
             {
                 numberString = entry[i] + numberString;
             }
             if ((!string.IsNullOrEmpty(numberString) && !char.IsDigit(entry[i])) || entry[i] == '\\') break;
         }
         if (string.IsNullOrEmpty(numberString)) numberString = "-1";
         result.Priority = int.Parse(numberString);
         result.Name = entry;
         allZipFiles.Add(result);
     }
     return allZipFiles;
 }
 private List<CustomFile> getFileListFromImageList(List<Image> currentPictures)
 {
     List<CustomFile> results = new List<CustomFile>();
     CustomFile result;
     foreach (Image entry in currentPictures)
     {
         result = new CustomFile();
         result.Name = entry.Name.FullName;
         result.Priority = entry.Priority;
         results.Add(result);
     }
     return results;
 }