예제 #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
                                       );
                }
            }
        }
예제 #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
                    );
                }
            }
        }
예제 #3
0
        public void GetMemberBindings(BindingBuilder builder)
        {
            var recordBluePrints = _sessionFactoryHolder.GetSessionFactoryParameters().RecordDescriptors;

            foreach (var record in recordBluePrints)
            {
                var properties = record.Type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
                if (properties == null)
                {
                    continue;
                }

                foreach (var property in properties)
                {
                    builder.Add(property, property.Name, property.Name);
                }
            }
        }
예제 #4
0
        public void GetMemberBindings(BindingBuilder builder)
        {
            var recordBluePrints = _sessionFactoryHolder.GetSessionFactoryParameters().RecordDescriptors;

            foreach (var record in recordBluePrints)
            {
                var properties = record.Type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
                if (properties == null)
                {
                    continue;
                }

                foreach (var property in properties)
                {
                    builder.Add(property, property.Name, property.Name);
                }
            }
        }