Beispiel #1
0
        public static string FindToSortPath(SecFileType filetype)
        {
            string mylocation = AppDomain.CurrentDomain.BaseDirectory;

            mylocation += "\\" + filetype.ToString() + "Files";
            return(mylocation);
        }
Beispiel #2
0
        public static List <string> GatherFiles(string path, SecFileType filetype)
        {
            string[]      files       = System.IO.Directory.GetFiles(path);
            List <string> ReturnValue = new List <string>();

            for (int i = 0; i < files.Length; i++)
            {
                ReturnValue.Add(files[i]);
            }
            Console.WriteLine("Found " + ReturnValue.Count + " " + filetype.ToString() + " files");
            return(ReturnValue);
        }
Beispiel #3
0
        public static void SortFiles(List <string> files, string filepath, DateTime lastfiledate, DateTime todaytime, SecFileType filetype)
        {
            FindFileLoadOrder(files, filetype);
            bool confirm = true;

            if (files.Count < NeededFileCount(lastfiledate, todaytime, filetype))
            {
                Console.WriteLine("You do not have enough {0} files! You have {1} but you need {2}. Would you like to add them in anyways?",
                                  filetype.ToString(), files.Count, NeededFileCount(lastfiledate, todaytime, filetype));
                confirm = ChooseBetweenTwo("Yes", "No");
            }
            if (confirm)
            {
                MoveFiles(files, filepath, lastfiledate, filetype, true);
            }
        }
Beispiel #4
0
        public static void FindFileLoadOrder(List <string> files, SecFileType filetype)
        {
            Console.WriteLine("Did you scan the {0} files newest first, or oldest first?", filetype.ToString());
            bool Newest = ChooseBetweenTwo("Newest", "Oldest");

            if (Newest)
            {
                files.Reverse();
            }
        }
Beispiel #5
0
 public static void DisplayLastDate(SecFileType filetype, DateTime lastfiledate)
 {
     Console.WriteLine("Latest {0} file is dated at {1}", filetype.ToString(), lastfiledate.ToShortDateString());
 }