Exemplo n.º 1
0
        public static void RegisterStyles(this PluginContainer pluginContainer, PluginStyleRegistry registry)
        {
            StyleList styles = new StyleList();

            pluginContainer.ExecuteMethod("RegisterStyles", styles);

            styles.ForEach(s => registry.Add(pluginContainer.Tag as Plugin, s.Url, psc => s.PageCondition(new StyleContext(psc))));
        }
Exemplo n.º 2
0
        public static void RegisterScripts(this PluginContainer pluginContainer, PluginScriptRegistry registry)
        {
            ScriptList scripts = new ScriptList();

            pluginContainer.ExecuteMethod("RegisterScripts", scripts);

            scripts.ForEach(s => registry.Add(pluginContainer.Tag as Plugin, s.Url, psc => s.PageCondition(new ScriptContext(psc))));
        }
Exemplo n.º 3
0
        public static void RegisterRoutes(this PluginContainer pluginContainer, RouteCollection routes)
        {
            RouteList pluginRoutes = new RouteList();

            pluginContainer.ExecuteMethod("RegisterRoutes", pluginRoutes);

            pluginRoutes.ForEach(r => routes.Add(pluginContainer.GetRouteName(r.MethodName), new PluginRoute(((Plugin)pluginContainer.Tag).ID, r.MethodName, r.Url, r.MergeWithDefaults(new { controller = "Plugin", action = "CallMethod" }), r.MergeWithConstraints(null))));
        }
Exemplo n.º 4
0
        public static void RegisterTemplates(this PluginContainer pluginContainer, PluginTemplateRegistry registry)
        {
            TemplateList templates = new TemplateList();

            pluginContainer.ExecuteMethod("RegisterTemplates", templates);

            templates.ForEach(t => registry.Add(pluginContainer.Tag as Plugin, t.TemplateName, t.Selector, (PluginTemplateSelectorType)(int)t.SelectorType, ptc => t.PageCondition(new TemplateContext(ptc)), t.ModelTarget));
        }
 public static void Unload(this PluginContainer pluginContainer)
 {
     pluginContainer.ExecuteMethod("Unload");
 }
 public static void Initialize(this PluginContainer pluginContainer)
 {
     pluginContainer.ExecuteMethod("Initialize");
 }