private String bindAutoData(IBlock sectionBlock, ContentSection section) { IList setttingLinks = getAutoBinderSettingLinks(section); bindSettingLink(sectionBlock, setttingLinks); Dictionary <string, string> presult = getDefaultValue(section); IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult); if (section.TemplateId <= 0) { return(getJsonResult(section, data)); } ContentSectionTemplate tpl = templatelService.GetById(section.TemplateId); Template currentView = utils.getTemplateByFileName(BinderUtils.GetBinderTemplatePath(tpl)); ISectionBinder binder = BinderUtils.GetBinder(tpl, ctx, currentView); binder.Bind(section, data); ControllerBase cb2 = binder as ControllerBase; return(cb2.utils.getActionResult()); }
public void AddSectionBinder(ISectionBinder sectionBinder) { if (sectionBinder == null) { throw new ArgumentNullException(nameof(sectionBinder)); } _binders.Add(_counter++, sectionBinder); }
private String getAutoData(ContentSection section) { Dictionary <string, string> presult = getDefaultValue(section); IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult); if (section.TemplateId <= 0) { return(getJsonResult(section, data)); } ISectionBinder binder = BinderUtils.GetBinder(section, ctx); binder.Bind(section, data); ControllerBase sectionController = binder as ControllerBase; return(sectionController.utils.getActionResult()); }
private String getAutoData(ContentSection section) { Dictionary <string, string> presult = getDefaultValue(section); IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult); if (section.TemplateId <= 0) { return(getJsonResult(section, data)); } ContentSectionTemplate sectionTemplate = TplService.GetById(section.TemplateId); Template currentView = utils.getTemplateByFileName(BinderUtils.GetBinderTemplatePath(sectionTemplate)); ISectionBinder binder = BinderUtils.GetBinder(sectionTemplate, ctx, currentView); binder.Bind(section, data); // custom template : SectionUtil.loadTemplate ControllerBase sectionController = binder as ControllerBase; return(sectionController.utils.getActionResult()); }
private String bindAutoData(IBlock sectionBlock, ContentSection section) { IList setttingLinks = getAutoBinderSettingLinks(section); bindSettingLink(sectionBlock, setttingLinks); Dictionary <string, string> presult = getDefaultValue(section); IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult); if (section.TemplateId <= 0) { return(getJsonResult(section, data)); } ISectionBinder binder = BinderUtils.GetBinder(section, ctx); binder.Bind(section, data); ControllerBase cb2 = binder as ControllerBase; return(cb2.utils.getActionResult()); }
public void AddSectionBinder(ISectionBinder sectionBinder) { _settingsBuilderFactory.AddSectionBinder(sectionBinder); }
public SettingsBindingException(ISectionBinder binder, BindingContext conextBindingContext, Exception e) : base(Resources.SettingsBindingExceptionMessage(binder, conextBindingContext.Section, conextBindingContext.Key), e) { }
public static string SettingsBindingExceptionMessage(ISectionBinder binder, string section, string key) => $@"An error has occurred while [{binder.GetType().FullName}] tried to bind section [{section}] with key [{key}], if this is custom binding check your implementation of ISectionBinder. If this is ExistForAll.Settings binder please let us know on github." ;