Exemplo n.º 1
0
        public List <TXFileInfo> GetRecentFilesAndFolders(IEnumerable <string> extraFiles, IEnumerable <string> extraFolders)
        {
            using (Log.DebugCall())
            {
                try
                {
                    string[]          recentFileNames   = null;
                    string[]          recentFolderNames = null;
                    FileFolderChecker checker           = new FileFolderChecker();

                    // Read both files under the mutex, then process the contents.

                    RecentlyCreated.GetFilesAndFolders(Log, out recentFileNames, out recentFolderNames);

                    if (recentFileNames != null)
                    {
                        checker.CheckFiles(recentFileNames, fromRecentFiles: true);
                    }

                    if (recentFolderNames != null)
                    {
                        checker.CheckFolders(recentFolderNames, fromRecentFiles: true);
                    }

                    // The "extra" files and folders are paths that might or might not be
                    // the recent files/folders lists, but the client wants us to check on.
                    // Typically they are from the Viewer's "recently viewed" lists.

                    if (extraFiles != null)
                    {
                        checker.CheckFiles(extraFiles, fromRecentFiles: false);
                    }

                    if (extraFolders != null)
                    {
                        checker.CheckFolders(extraFolders, fromRecentFiles: false);
                    }

                    Log.Debug("Returning ", checker.CombinedResult.Count, " items.");
                    return(checker.CombinedResult);
                }
                catch (Exception ex)
                {
                    Log.Error("Exception in GetRecentFilesAndFolders(): ", ex);
                    throw;
                    //throw new FaultException<ExceptionDetail>(new ExceptionDetail(ex), "Exception in GetRecentFilesAndFolders() (on the server).");
                }
            }
        }