/// <summary> /// Creates a new <seealso cref="ExecutableScript" /> from a dynamic resource. Dynamic means that the source /// is an expression which will be evaluated during execution. /// </summary> /// <param name="language"> the language of the script </param> /// <param name="resourceExpression"> the expression which evaluates to the resource path </param> /// <param name="scriptFactory"> the script factory used to create the script </param> /// <returns> the newly created script </returns> /// <exception cref="NotValidException"> if language is null or empty or resourceExpression is null </exception> public static ExecutableScript GetScriptFromResourceExpression(string language, IExpression resourceExpression, ScriptFactory scriptFactory) { EnsureUtil.EnsureNotEmpty(typeof(NotValidException), "Script language", language); EnsureUtil.EnsureNotNull(typeof(NotValidException), "Script resource expression", resourceExpression); return(scriptFactory.CreateScriptFromResource(language, resourceExpression)); }