Axiom.FileSystem.FileSystemArchive.SafeDirectoryChange C# (CSharp) Метод

SafeDirectoryChange() защищенный Метод

protected SafeDirectoryChange ( string directory, System.Action action ) : void
directory string
action System.Action
Результат 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();
				}
			}
		}