public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel) { if (fieldType != "DatetimeField") { return; } var model = new DatetimeFieldSettings(); if (updateModel.TryUpdateModel(model, "DatetimeFieldSettings", null, null)) { UpdateSettings(model, settingsDictionary, "DatetimeFieldSettings"); settingsDictionary["DatetimeFieldSettings.DefaultValue"] = model.DefaultValue.ToString(); } }
public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { if (builder.FieldType != "DatetimeField") { yield break; } var model = new DatetimeFieldSettings(); if (updateModel.TryUpdateModel(model, "DatetimeFieldSettings", null, null)) { UpdateSettings(model, builder, "DatetimeFieldSettings"); builder.WithSetting("DatetimeFieldSettings.DefaultValue", model.DefaultValue.ToString()); } yield return DefinitionTemplate(model); }
public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel) { if (fieldType != "DatetimeField") { return; } var model = new DatetimeFieldSettings(); if (updateModel.TryUpdateModel(model, "DatetimeFieldSettings", null, null)) { UpdateSettings(model, settingsDictionary, "DatetimeFieldSettings"); settingsDictionary["DatetimeFieldSettings.DefaultValue"] = model.DefaultValue.ToString(); } }