Beispiel #1
0
        private void EachTemplate(Func <GroupTemplateContext, bool> handler)
        {
            var excludeFilter = new CompositeResourceFilter();

            //add a filter to exclude all resources that match the consolidated url of a group
            excludeFilter.AddFilter(new ConsolidatedUrlFilter(_templates));
            foreach (var groupTemplate in _templates)
            {
                var templateContext = groupTemplate.WithContext(excludeFilter);
                if (!handler(templateContext))
                {
                    break;
                }

                excludeFilter.AddFilter(groupTemplate);
            }
        }
        public CompositeResourceFilter Clone()
        {
            var clone = new CompositeResourceFilter();
            foreach (IResourceFilter filter in _filters)
            {
                clone.AddFilter(filter);
            }

            return clone;
        }
Beispiel #3
0
        public CompositeResourceFilter Clone()
        {
            var clone = new CompositeResourceFilter();

            foreach (IResourceFilter filter in _filters)
            {
                clone.AddFilter(filter);
            }

            return(clone);
        }
Beispiel #4
0
        public void TwoTruesReturnsTrue()
        {
            _instance.AddFilter(ResourceFilters.True);
            _instance.AddFilter(ResourceFilters.True);

            Assert.That(_instance.IsMatch(null), Is.True);
        }
Beispiel #5
0
        private void EachTemplate(Func<GroupTemplateContext,bool> handler)
        {
            var excludeFilter = new CompositeResourceFilter();
            //add a filter to exclude all resources that match the consolidated url of a group
            excludeFilter.AddFilter(new ConsolidatedUrlFilter(_templates));
            foreach (var groupTemplate in _templates)
            {
                var templateContext = groupTemplate.WithContext(excludeFilter);
                if(!handler(templateContext))
                    break;

                if(MutuallyExclusiveGroups)
                    excludeFilter.AddFilter(groupTemplate);
            }
        }