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

            foreach (string engine in ScriptEngineFactory.Engines)
            {
                string name = ScriptEngineFactory.GetDescriptionForEngine(engine);
                if (name != null)
                {
                    List <CANAPETemplate> templates = new List <CANAPETemplate>();

                    templates.Add(new CANAPETemplate(CANAPE.Properties.Resources.SelectScriptTemplateForm_EmptyScript,
                                                     CANAPE.Properties.Resources.SelectScriptTemplateForm_EmptyScriptDescription, engine, new byte[0]));

                    foreach (CANAPETemplate template in ScriptUtils.GetTemplates(engine))
                    {
                        templates.Add(template);
                    }

                    ret.Add(name, templates);
                }
            }

            return(ret);
        }