Esempio n. 1
0
        public void Describe(DescribeFilterContext describe)
        {
            var builder = new BindingBuilder();

            foreach (var bindingProvider in _bindingProviders)
            {
                bindingProvider.GetMemberBindings(builder);
            }

            var groupedMembers = builder.Build().GroupBy(b => b.Property.DeclaringType).ToDictionary(b => b.Key, b => b);

            foreach (var typeMembers in groupedMembers.Keys)
            {
                var descriptor = describe.For(typeMembers.Name, (typeMembers.Name.CamelFriendly()), string.Format("Members for {0}", typeMembers.Name));
                foreach (var member in groupedMembers[typeMembers])
                {
                    var    closureMember = member;
                    string formName      = _filterCoordinator.GetForm(closureMember.Property.PropertyType);
                    descriptor.Element(member.Property.Name, member.DisplayName, member.Description,
                                       context => ApplyFilter(context, closureMember.Property),
                                       formName
                                       );
                }
            }
        }
Esempio n. 2
0
        public void Describe(DescribeFilterContext describe)
        {
            var builder = new BindingBuilder();

            foreach (var bindingProvider in _bindingProviders)
            {
                bindingProvider.GetMemberBindings(builder);
            }

            var groupedMembers = builder.Build().GroupBy(b => b.Property.DeclaringType).ToDictionary(b => b.Key, b => b);

            foreach (var typeMembers in groupedMembers.Keys)
            {
                var descriptor = describe.For(typeMembers.Name, (typeMembers.Name.CamelFriendly()), string.Format("Members for {0}", typeMembers.Name));
                foreach (var member in groupedMembers[typeMembers])
                {
                    var closureMember = member;
                    string formName = _filterCoordinator.GetForm(closureMember.Property.PropertyType);
                    descriptor.Element(member.Property.Name, member.DisplayName, member.Description,
                        context => ApplyFilter(context, closureMember.Property),
                        formName
                    );
                }
            }
        }
Esempio n. 3
0
        private IEnumerable<FilterDescriptor> DescribeFilters()
        {
            var context = new DescribeFilterContext();

            foreach (var provider in _filterProviders)
            {
                provider.Describe(context);
            }

            return context.Describe();
        }