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

            var settings = new SpamFilterPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "SpamFilterPartSettings", null, null)) {
                builder.WithSetting("SpamFilterPartSettings.Action", settings.Action.ToString());
                builder.WithSetting("SpamFilterPartSettings.Pattern", settings.Pattern);
            }

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

            var settings = new SpamFilterPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "SpamFilterPartSettings", null, null))
            {
                builder.WithSetting("SpamFilterPartSettings.Action", settings.Action.ToString());
                builder.WithSetting("SpamFilterPartSettings.Pattern", settings.Pattern);
            }

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

            var settings = new SpamFilterPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "SpamFilterPartSettings", null, null)) {
                builder.WithSetting("SpamFilterPartSettings.Action", settings.Action.ToString());
                builder.WithSetting("SpamFilterPartSettings.DeleteSpam", settings.DeleteSpam.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("SpamFilterPartSettings.UrlPattern", settings.UrlPattern);
                builder.WithSetting("SpamFilterPartSettings.PermalinkPattern", settings.PermalinkPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorPattern", settings.CommentAuthorPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorUrlPattern", settings.CommentAuthorUrlPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorEmailPattern", settings.CommentAuthorEmailPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentContentPattern", settings.CommentContentPattern);
            }

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

            var settings = new SpamFilterPartSettings {
            };

            if (updateModel.TryUpdateModel(settings, "SpamFilterPartSettings", null, null))
            {
                builder.WithSetting("SpamFilterPartSettings.Action", settings.Action.ToString());
                builder.WithSetting("SpamFilterPartSettings.DeleteSpam", settings.DeleteSpam.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("SpamFilterPartSettings.UrlPattern", settings.UrlPattern);
                builder.WithSetting("SpamFilterPartSettings.PermalinkPattern", settings.PermalinkPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorPattern", settings.CommentAuthorPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorUrlPattern", settings.CommentAuthorUrlPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentAuthorEmailPattern", settings.CommentAuthorEmailPattern);
                builder.WithSetting("SpamFilterPartSettings.CommentContentPattern", settings.CommentContentPattern);
            }

            yield return(DefinitionTemplate(settings));
        }