Пример #1
0
 /// <summary>
 /// Set File Time
 /// </summary>
 internal void SetTimeDateEachFile(string directoryPath, DateTime fileDateTime)
 {
     try
     {
         string[] subFiles = Directory.GetFiles(directoryPath);
         Array.Sort(subFiles, SharedHelper.explorerStringComparer());
         foreach (string filename in subFiles)
         {
             AddONEFiletoConfirmList(filename, fileDateTime, false);
         }
     } //catch for GetFiles
     catch (UnauthorizedAccessException)
     { }
 }
Пример #2
0
        /// <summary>
        /// Display subfiles and subdirectories in the right panel listview  and show a file icon
        /// </summary>
        /// <param name="filesonly">Don't show the directories, only files.</param>
        internal void DisplayContentsList(bool checkboxRecurse, string labelname, bool filesonly = true)
        {
            //Clear the datamodel + contents UI
            Clear(true);

            string directoryName = labelname;

            if (!Directory.Exists(directoryName))
            {
                return;
            }

            //Directories:
            if (!filesonly && checkboxRecurse)
            {
                try
                {
                    PopulateDirList(directoryName);
                }
                catch (UnauthorizedAccessException)
                { }
                //Sort them
                contentsDirList.Sort(SharedHelper.explorerStringComparer());
                //Add them to the listview.
                foreach (string subDirectory in contentsDirList)
                {
                    // Display all the sub directories using the directory icon (enum 1)
                    listViewContents.Items.Add(subDirectory, (int)ListViewIcon.Directory);
                }
            }

            //Files: (Display all of the files and show a file icon)
            try
            {
                AddImagesExtsToFileLists(directoryName);
            }
            catch (UnauthorizedAccessException)
            { }
            //Sort them
            contentsFileList.Sort(SharedHelper.explorerStringComparer());
            //Add them to the listview.
            foreach (string file in contentsFileList)
            {
                string exten = Path.GetExtension(file);
                listViewContents.Items.Add(file, exten != ".lnk" ? exten : file);
            }
        }
Пример #3
0
        // These just point back to the above functions, using the parent folderinstead.

        /// <summary>
        /// Set Directory Time
        /// </summary>
        internal void SetTimeDateEachDirectory(string directoryPath, DateTime fileDateTime)
        {
            try
            {
                string[] subDirectories = Directory.GetDirectories(directoryPath);
                Array.Sort(subDirectories, SharedHelper.explorerStringComparer());
                foreach (string eachdir in subDirectories)
                {
                    // Set the date/time for the sub directory
                    AddONEFiletoConfirmList(eachdir, fileDateTime, true);
                    // Recurse (loop) through each sub-sub directory
                    RecurseSubDirectoryMode1(eachdir);
                }
            } //catch for GetDirs
            catch (UnauthorizedAccessException)
            { }
        }