Example #1
0
        /// <summary>
        /// Initialize plugin infrastructure.
        /// </summary>
        private void InitializePlugins()
        {
            pluginsContainer = new PluginContainer("~/Plugins", Container);

            // set controller factory for plugins.
            // apply the unity decorator so that all controllers will be built up
            // by Unity.
            pluginsContainer.SetControllerFactory(ControllerBuilder.Current)
                .DecorateController += c => Container.BuildUp(c);
            pluginsContainer.AddViewEngine(ViewEngines.Engines);

            // compose this app for the route providers
            pluginsContainer.CompositionContainer.ComposeParts(this);

            Debug.WriteLine(PluginBootstrappers.Count());
            foreach (var bootstrapper in PluginBootstrappers) {
                var bootstrapperWithContainer = bootstrapper as IWithContainer;
                if (bootstrapperWithContainer != null)
                    Container.BuildUp(bootstrapperWithContainer);
                bootstrapper.Boot();
            }
        }
Example #2
0
 public PluginViewEngine(PluginContainer container)
 {
     DescriptorBuilder = new PluginDescriptorBuilder(Engine, container.PluginsPath);
 }