BExplorer.Shell.KnownFolderSettings.GetPath C# (CSharp) Method

GetPath() private method

Gets the path of this this known folder.
private GetPath ( bool &fileExists, IKnownFolderNative knownFolderNative ) : string
fileExists bool /// Returns false if the folder is virtual, or a boolean /// value that indicates whether this known folder exists. ///
knownFolderNative IKnownFolderNative Native IKnownFolder reference
return string
        private string GetPath(out bool fileExists, IKnownFolderNative knownFolderNative)
        {
            Debug.Assert(knownFolderNative != null);

            string kfPath = string.Empty;
            fileExists = true;

            // Virtual folders do not have path.
            if (knownFolderProperties.category == FolderCategory.Virtual)
            {
                fileExists = false;
                return kfPath;
            }

            try
            {
                kfPath = knownFolderNative.GetPath(0);
            }
            catch (System.IO.FileNotFoundException)
            {
                fileExists = false;
            }
            catch (System.IO.DirectoryNotFoundException)
            {
                fileExists = false;
            }

            return kfPath;
        }