public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.Name != "VoteUpDownPart")
                yield break;

            var model = new VoteUpDownTypePartSettings();
            updateModel.TryUpdateModel(model, "VoteUpDownTypePartSettings", null, null);
            builder.WithSetting("VoteUpDownTypePartSettings.ShowVoter", model.ShowVoter.ToString());
            builder.WithSetting("VoteUpDownTypePartSettings.AllowAnonymousRatings", model.AllowAnonymousRatings.ToString());

            yield return DefinitionTemplate(model);
        }
Пример #2
0
        public override IEnumerable <TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.Name != "VoteUpDownPart")
            {
                yield break;
            }

            var model = new VoteUpDownTypePartSettings();

            updateModel.TryUpdateModel(model, "VoteUpDownTypePartSettings", null, null);
            builder.WithSetting("VoteUpDownTypePartSettings.ShowVoter", model.ShowVoter.ToString());
            builder.WithSetting("VoteUpDownTypePartSettings.AllowAnonymousRatings", model.AllowAnonymousRatings.ToString());

            yield return(DefinitionTemplate(model));
        }