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 ); } } }
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); } } }