Пример #1
0
        private static Dictionary <string, List <CANAPETemplate> > CreateTemplates()
        {
            Dictionary <string, List <CANAPETemplate> > ret = new Dictionary <string, List <CANAPETemplate> >();

            ret["Proxy"] = new List <CANAPETemplate>();
            ret["Proxy"].AddRange(CANAPEExtensionManager.GetTemplates(typeof(CANAPEProject), "proxy"));
            ret["Server"] = new List <CANAPETemplate>();
            ret["Server"].AddRange(CANAPEExtensionManager.GetTemplates(typeof(CANAPEProject), "server"));

            return(ret);
        }
Пример #2
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]);
            }
        }