Beispiel #1
0
        public static Plugin From(IPluginTemplate p)
        {
            Plugin n = new Plugin();

            n.FullClassName = p.FullClassName;
            n.DLLName       = p.DLLName;

            return(n);
        }
        public IPluginTemplate Build(string fullClassName)
        {
            IPluginTemplate pt = null;

            using (var ctx = new Entities())
            {
                var ptdb = (from t in ctx.PluginTemplates
                            where t.FullClassName == fullClassName
                            select t).FirstOrDefault();
                pt = BuildPluginTemplate(ptdb);
            }
            return(pt);
        }
        private IPluginTemplate BuildPluginTemplate(PluginTemplate ptdb)
        {
            IPluginTemplate pt = null;

            if (ptdb != null)
            {
                pt = new DefaultPluginTemplate()
                {
                    DLLName       = ptdb.DLLName,
                    FullClassName = ptdb.FullClassName
                };
            }
            return(pt);
        }
Beispiel #4
0
 public void Add(string name, IPluginTemplate template)
 {
     templates.Add(name, template);
 }