Exemple #1
0
        public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.Name != "CustomCss")
                yield break;

            var model = new CustomCssSettings();
            updateModel.TryUpdateModel(model, "CustomCssSettings", null, null);
            builder
                .WithSetting("CustomCssSettings.CustomId", !string.IsNullOrWhiteSpace(model.CustomId) ? model.CustomId : null)
                .WithSetting("CustomCssSettings.CssClass", !string.IsNullOrWhiteSpace(model.CssClass) ? model.CssClass : null)
                .WithSetting("CustomCssSettings.Scripts", !string.IsNullOrWhiteSpace(model.Scripts) ? model.Scripts : null);
            yield return DefinitionTemplate(model);
        }
        public override IEnumerable <TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.Name != "CustomCss")
            {
                yield break;
            }

            var model = new CustomCssSettings();

            updateModel.TryUpdateModel(model, "CustomCssSettings", null, null);
            builder
            .WithSetting("CustomCssSettings.CustomId", !string.IsNullOrWhiteSpace(model.CustomId) ? model.CustomId : null)
            .WithSetting("CustomCssSettings.CssClass", !string.IsNullOrWhiteSpace(model.CssClass) ? model.CssClass : null)
            .WithSetting("CustomCssSettings.Scripts", !string.IsNullOrWhiteSpace(model.Scripts) ? model.Scripts : null);
            yield return(DefinitionTemplate(model));
        }