public LocalizedString DisplayFilter(FilterContext context)
        {
            var values = new TokenizedContentTypeFilterFormElements(context.State);

            return(string.IsNullOrEmpty(values.ContentTypes) ?
                   T("Any type of content.") :
                   T("Content with the type matching with \"{0}\".", values.ContentTypes));
        }
        public void ApplyFilter(FilterContext context)
        {
            var values = new TokenizedContentTypeFilterFormElements(context.State);

            if (!string.IsNullOrEmpty(values.ContentTypes))
            {
                context.Query = context.Query.ForType(values.ContentTypes
                                                      .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(type => type.Trim()).ToArray());
            }
        }