public bool HasAccess(string template)
{
string filePath = Utils.GetAbsoluteFilePath(m_directory.FullName + template + m_FileExtension, false, false, false);
// nothing more to do if no file.
if (filePath == null)
{
return false;
}
// check if account has access to semaphore file.
try
{
using (Stream ostrm = File.OpenRead(filePath))
{
ostrm.Dispose();
}
// access granted.
return true;
}
catch (Exception)
{
// no access or no file.
}
return false;
}