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;
}