public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { if (builder.FieldType != "MediaGalleryField") { yield break; } var model = new MediaGalleryFieldSettings(); if (updateModel.TryUpdateModel(model, "MediaGalleryFieldSettings", null, null)) { builder.WithSetting("MediaGalleryFieldSettings.Hint", model.Hint); builder.WithSetting("MediaGalleryFieldSettings.AllowedExtensions", model.AllowedExtensions); builder.WithSetting("MediaGalleryFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("MediaGalleryFieldSettings.Multiple", model.Multiple.ToString(CultureInfo.InvariantCulture)); } yield return DefinitionTemplate(model); }
public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { if (builder.FieldType != "MediaGalleryField") { yield break; } var model = new MediaGalleryFieldSettings(); if (updateModel.TryUpdateModel(model, "MediaGalleryFieldSettings", null, null)) { builder.WithSetting("MediaGalleryFieldSettings.Hint", model.Hint); builder.WithSetting("MediaGalleryFieldSettings.AllowedExtensions", model.AllowedExtensions); builder.WithSetting("MediaGalleryFieldSettings.Required", model.Required.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("MediaGalleryFieldSettings.Multiple", model.Multiple.ToString(CultureInfo.InvariantCulture)); } yield return(DefinitionTemplate(model)); }