Ejemplo n.º 1
0
        /// <summary>
        /// this function is searching throw a specified directory chosen by the user
        /// and sends the results in the end of the searching to the DbManager functions.
        /// </summary>
        /// <param name="sDir"></param>
        /// <param name="fileName"></param>
        /// <param name="pathRoot"></param>
        public static void FileSearcherInChosenDir(string sDir, string fileName, string pathRoot)
        {
            //calling an event which updates the searchId.
            FilesDbUpDateHandler?.Invoke();

            FileSearchInDirRoot(sDir, fileName, pathRoot);

            foreach (string item in files)
            {
                DbManager.UpdateDbResults(searchId, item, pathRoot);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// this function is searching throw all the drives in the PC and sends the results in the
        /// end of the searching to the DbManager functions.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="allDir"></param>
        public static void FileSearcherInAllDir(string fileName, string allDir)
        {
            FilesDbUpDateHandler?.Invoke();

            foreach (DriveInfo drive in DriveInfo.GetDrives())
            {
                FileSearchInDirRoot($"{drive}", fileName, allDir);
            }
            foreach (string item in files)
            {
                DbManager.UpdateDbResults(searchId, item, "allDirectories");
            }
        }