예제 #1
0
 public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel) {
     if (fieldType != "PhoneField") {
         return;
     }
     var model = new PhoneFieldSettings();
     if (updateModel.TryUpdateModel(model, "PhoneFieldSettings", null, null)) {
         UpdateSettings(model, settingsDictionary, "PhoneFieldSettings");
         settingsDictionary["PhoneFieldSettings.DefaultValue"] = model.DefaultValue;
     }
 }
예제 #2
0
        public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.FieldType != "PhoneField") {
                yield break;
            }

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

            yield return DefinitionTemplate(model);
        }
예제 #3
0
        public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel)
        {
            if (fieldType != "PhoneField")
            {
                return;
            }
            var model = new PhoneFieldSettings();

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