private static void RegisterToolboxItem(Telerik.Sitefinity.DynamicModules.Builder.Model.DynamicModule dynamicModule, DynamicModuleType moduleType) { MvcWidgetInstaller.UnregisterToolboxItem(moduleType.GetFullTypeName()); var configurationManager = ConfigManager.GetManager(); var toolboxesConfig = configurationManager.GetSection <ToolboxesConfig>(); var section = MvcWidgetInstaller.GetModuleToolboxSection(dynamicModule, toolboxesConfig); if (section == null) { return; } var toolboxItem = new ToolboxItem(section.Tools) { Name = moduleType.GetFullTypeName() + "_MVC", Title = PluralsResolver.Instance.ToPlural(moduleType.DisplayName), Description = string.Empty, ModuleName = dynamicModule.Name, ControlType = typeof(MvcWidgetProxy).AssemblyQualifiedName, ControllerType = typeof(DynamicContentController).FullName, CssClass = "sfNewsViewIcn sfMvcIcn", Parameters = new NameValueCollection() { { "WidgetName", moduleType.TypeName }, { "ControllerName", typeof(DynamicContentController).FullName } } }; section.Tools.Add(toolboxItem); configurationManager.SaveSection(toolboxesConfig); }
private static void RegisterTemplates(Telerik.Sitefinity.DynamicModules.Builder.Model.DynamicModule dynamicModule, DynamicModuleType dynamicModuleType, string transactionName) { MvcWidgetInstaller.TemplateGaneratorAction( templateGenerator => { templateGenerator.InstallMasterTemplate(dynamicModule, dynamicModuleType); templateGenerator.InstallDetailTemplate(dynamicModule, dynamicModuleType); }, transactionName); }