Пример #1
0
 public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel) {
     if (fieldType != "DateField") {
         return;
     }
     var model = new DateFieldSettings();
     if (updateModel.TryUpdateModel(model, "DateFieldSettings", null, null)) {
         UpdateSettings(model, settingsDictionary, "DateFieldSettings");
         settingsDictionary["DateFieldSettings.DefaultValue"] = model.DefaultValue.ToString();
     }
 }
Пример #2
0
        public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.FieldType != "DateField") {
                yield break;
            }

            var model = new DateFieldSettings();
            if (updateModel.TryUpdateModel(model, "DateFieldSettings", null, null)) {
                UpdateSettings(model, builder, "DateFieldSettings");
                builder.WithSetting("DateFieldSettings.DefaultValue", model.DefaultValue.ToString());
            }

            yield return DefinitionTemplate(model);
        }
Пример #3
0
        public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel)
        {
            if (fieldType != "DateField")
            {
                return;
            }
            var model = new DateFieldSettings();

            if (updateModel.TryUpdateModel(model, "DateFieldSettings", null, null))
            {
                UpdateSettings(model, settingsDictionary, "DateFieldSettings");
                settingsDictionary["DateFieldSettings.DefaultValue"] = model.DefaultValue.ToString();
            }
        }