Exemplo n.º 1
0
        public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.Name != "ReCaptchaPart")
                yield break;

            var settings = new ReCaptchaPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "ReCaptchaPartSettings", null, null)) {
                builder.WithSetting("ReCaptchaPartSettings.PublicKey", settings.PublicKey);
                builder.WithSetting("ReCaptchaPartSettings.PrivateKey", settings.PrivateKey);
            }

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

            var settings = new ReCaptchaPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "ReCaptchaPartSettings", null, null))
            {
                builder.WithSetting("ReCaptchaPartSettings.PublicKey", settings.PublicKey);
                builder.WithSetting("ReCaptchaPartSettings.PrivateKey", settings.PrivateKey);
            }

            yield return(DefinitionTemplate(settings));
        }