public void Process(TagContentArgs args)
        {
            List <Tag> list = new List <Tag>();

            foreach (ITaxonomyProvider taxonomyProvider in args.Configuration.TaxonomyProviders)
            {
                IEnumerable <Tag> tags;
                if (taxonomyProvider is CustomizableTaxonomyProvider)
                {
                    tags = ((CustomizableTaxonomyProvider)taxonomyProvider).CreateTags(args.ContentItem, args.TagDataCollection);
                }
                else
                {
                    tags = taxonomyProvider.CreateTags(args.TagDataCollection);
                }
                list.AddRange(tags);
            }
            args.Tags = list;
        }
Esempio n. 2
0
        public void Process(TagContentArgs args)
        {
            var taggableContentList = new List <TaggableContent>();

            if (args.Content != null && args.Content.Any())
            {
                taggableContentList.AddRange(args.Content);
            }

            foreach (IContentProvider <Item> contentProvider in args.Configuration.ContentProviders)
            {
                var dataSoutceItems = args.ContentItem.GetDataSourceItems();
                foreach (var item in dataSoutceItems)
                {
                    var content = (StringContent)contentProvider.GetContent(item);

                    if (!string.IsNullOrEmpty(content.Content) && !string.IsNullOrEmpty(content.Content.Trim()))
                    {
                        taggableContentList.Add(content);
                    }
                }
            }
            args.Content = taggableContentList;
        }