public static bool TryGetLockFile(string path, out LockFile file)
{
bool success = false;
file = null;
try
{
Stream stream =
FileHelper.FileSystem.File.Open(
path,
FileMode.Create,
FileAccess.ReadWrite,
FileShare.Read);
success = true;
file = new LockFile(path, stream);
}
catch (IOException)
{
}
return success;
}