protected SafeDirectoryChange ( string directory, System.Action action ) : void | ||
directory | string | |
action | System.Action | |
return | void |
protected void SafeDirectoryChange( string directory, Action action )
{
if ( Directory.Exists( directory ) )
{
// Check we can change to it
pushDirectory( directory );
try
{
action();
}
catch ( Exception ex )
{
LogManager.Instance.Write( LogManager.BuildExceptionString( ex ) );
}
finally
{
// return to previous
popDirectory();
}
}
}