Example #1
0
        public void RegisterWebPluginRoutesAndBundles(RouteCollection routes, BundleCollection bundles)
        {
            Type iPluginType = typeof(IWebPlugin);
            PluginConfigManager bundleConfig = new PluginConfigManager();

            foreach (Assembly asm in _webPluginAssemblys)
            {
                foreach (Type type in asm.GetTypes())
                {
                    if (iPluginType.IsAssignableFrom(type))
                    {
                        IWebPlugin plugin = Activator.CreateInstance(type) as IWebPlugin;
                        bundleConfig.LoadResource(bundles, Path.Combine(
                                                      _webPluginsPath, plugin.Name, @"Configs\Bundle.config"));
                        plugin.RegisterRoutes(routes);
                        plugin.RegisterBundles(bundles);
                        break;
                    }
                }
            }
        }