Example #1
0
        public Content()
        {
            // create content hits collection.. 1 entry for every content type
            var contentTypes = Model.Config.GetFrontendFolders().Where(x => !x.IsDatabase).ToList();

            contentTypes.ForEach(contentType => ContentHitsCollection.Add(new ContentHits(contentType)));
        }
Example #2
0
        public void Update(Func <IEnumerable <string> > getFilteredContentTypes, Func <IEnumerable <string> > getFilteredHitTypes)
        {
            // standard properties to avoid cost of recalculating getters during every request (e.g. wpf bindings)
            IsSmelly       = ContentHitsCollection.Any(contentHits => contentHits.IsSmelly);
            SmellyHits     = new ObservableCollection <Hit>(ContentHitsCollection.SelectMany(contentHits => contentHits.SmellyHits).ToList());
            SmellyHitsView = new ListCollectionView(SmellyHits)
            {
                Filter = hitObject => getFilteredContentTypes().Contains(((Hit)hitObject).ContentType) &&
                         getFilteredHitTypes().Contains(((Hit)hitObject).Type.GetDescription())
            };

            Hits = new ObservableCollection <Hit>(ContentHitsCollection.SelectMany(contentHits => contentHits.Hits.ToList()));
        }