コード例 #1
0
        public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.Name != "ContainerPart")
                yield break;

            var model = new ContainableTypePartSettings();
            updateModel.TryUpdateModel(model, "ContainableTypePartSettings", null, null);
            builder.WithSetting("ContainableTypePartSettings.ShowContainerPicker", model.ShowContainerPicker.ToString());
            builder.WithSetting("ContainableTypePartSettings.ShowPositionEditor", model.ShowPositionEditor.ToString());
            yield return DefinitionTemplate(model);
        }
コード例 #2
0
        public override IEnumerable <TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.Name != "ContainablePart")
            {
                yield break;
            }

            var model = new ContainableTypePartSettings();

            updateModel.TryUpdateModel(model, "ContainableTypePartSettings", null, null);
            builder.WithSetting("ContainableTypePartSettings.ShowContainerPicker", model.ShowContainerPicker.ToString());
            builder.WithSetting("ContainableTypePartSettings.ShowPositionEditor", model.ShowPositionEditor.ToString());
            yield return(DefinitionTemplate(model));
        }