Exemplo n.º 1
0
 /// <summary>
 ///     Creates a new <seealso cref="ExecutableScript" /> from a static source.
 /// </summary>
 /// <param name="language"> the language of the script </param>
 /// <param name="source"> the source code of the script </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 source is null </exception>
 public static ExecutableScript GetScriptFromSource(string language, string source, ScriptFactory scriptFactory)
 {
     EnsureUtil.EnsureNotEmpty(typeof(NotValidException), "Script language", language);
     EnsureUtil.EnsureNotNull(typeof(NotValidException), "Script source", source);
     return(scriptFactory.CreateScriptFromSource(language, source));
 }