Exemplo n.º 1
0
        /// <summary>
        /// Get an array of script templates for a specified engine
        /// </summary>
        /// <param name="engine">The engine</param>
        /// <returns>An array of available templates</returns>
        public static IEnumerable <CANAPETemplate> GetTemplates(string engine)
        {
            Type engineType = ScriptEngineFactory.GetTypeForScriptEngine(engine);

            if (engineType != null)
            {
                return(CANAPEExtensionManager.GetTemplates(engineType, engine));
            }
            else
            {
                return(new CANAPETemplate[0]);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Unregister the type with the manager
 /// </summary>
 /// <param name="t">The type to unregister</param>
 public override void UnregisterType(Type t)
 {
     ScriptEngineFactory.RemoveScriptEngineFromType(this, t);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Get a script engine
 /// </summary>
 /// <param name="engine">The engine name</param>
 /// <param name="enableDebug">Whether to enable debug</param>
 /// <returns>The script engine instance</returns>
 private static IScriptEngine GetScriptEngine(string engine, bool enableDebug)
 {
     return(ScriptEngineFactory.GetScriptEngine(engine, enableDebug));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Register the type with the manager
 /// </summary>
 /// <param name="t">The type to register</param>
 public override void RegisterType(Type t)
 {
     ScriptEngineFactory.AddScriptEngineFromType(this, t);
 }