コード例 #1
0
 public override IEnumerable<TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel) {
     var settings = builder.Current.Settings;
     if (settings.ContainsKey("Stereotype") && settings["Stereotype"] == "Media") {
         var model = new MediaFileNameEditorSettings();
         if (updateModel.TryUpdateModel(model, "MediaFileNameEditorSettings", null, null)) {
             builder.WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", model.ShowFileNameEditor.ToString());
         }
     }
     return base.TypeEditorUpdate(builder, updateModel);
 }
コード例 #2
0
        public override IEnumerable <TemplateViewModel> TypeEditorUpdate(ContentTypeDefinitionBuilder builder, IUpdateModel updateModel)
        {
            var settings = builder.Current.Settings;

            if (settings.ContainsKey("Stereotype") && settings["Stereotype"] == "Media")
            {
                var model = new MediaFileNameEditorSettings();
                if (updateModel.TryUpdateModel(model, "MediaFileNameEditorSettings", null, null))
                {
                    builder.WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", model.ShowFileNameEditor.ToString());
                }
            }
            return(base.TypeEditorUpdate(builder, updateModel));
        }