iox/Shell.cs
/// <summary>
/// Execute code safely using the Iodine engine.
/// </summary>
/// <returns>The iodine operation.</returns>
/// <param name="instance">Instance.</param>
/// <param name="action">Action.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
Execute code safely using the Iodine engine.
Execute code safely using the Iodine engine .
static T WrapIodineOperation<T> (Shell instance, Func<T> action) where T: IodineObject {
			try {
				return action ();
			} catch (Iodine.Compiler.SyntaxException e) {
				IodineExceptionHandler.HandleSyntaxException (instance, e);
			} catch (UnhandledIodineExceptionException e) {
				IodineExceptionHandler.HandleUnhandledIodineException (instance, e);
			} catch (ModuleNotFoundException e) {
				IodineExceptionHandler.HandleModuleNotFoundException (instance, e);
			} catch (Exception e) {
				Console.WriteLine (e.Message);
			}
			return null;
		}
static T WrapIodineOperation < T > ( Shell instance , Func < T > action ) where T : IodineObject { try { return action ( ) ; } catch ( Iodine . Compiler . SyntaxException e ) { IodineExceptionHandler . HandleSyntaxException ( instance , e ) ; } catch ( UnhandledIodineExceptionException e ) { IodineExceptionHandler . HandleUnhandledIodineException ( instance , e ) ; } catch ( ModuleNotFoundException e ) { IodineExceptionHandler . HandleModuleNotFoundException ( instance , e ) ; } catch ( Exception e ) { Console . WriteLine ( e . Message ) ; } return null ; }
Execute code safely using the Iodine engine.
Execute code safely using the Iodine engine .
// Try to just run the specified operation // Handle exception // Handle exception // Handle exception // The Iodine engine exploded and we have no idea why. // Show the error to the user, maybe he can do something useful with it. // Nothing to do here
The iodine operation.
The iodine operation .
instance
Shell
None
action
Func<T>
None
typeparam
The 1st type parameter.
The 1st type parameter .