public void Describe(DescribePropertyContext 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, new LocalizedString(typeMembers.Name.CamelFriendly()), T("Members for {0}", typeMembers.Name)); foreach (var member in groupedMembers[typeMembers]) { var closureMember = member; descriptor.Element(member.Property.Name, member.DisplayName, member.Description, context => Display(context, closureMember.Property), (context, contentItem) => Render(context, closureMember.Property, contentItem), _propertyFormater.GetForm(member.Property.PropertyType) ); } } }
public void Describe(DescribePropertyContext describe) { describe.For("Content", T("Content"), T("Content properties")) .Element("CustomValue", T("Custom Value"), T("A static text. Use it for custom tokens with Rewrite options."), DisplayProperty, RenderProperty ); }
public void Describe(DescribePropertyContext describe) { describe.For("Content", T("Content"), T("Content properties")) .Element("Metadata:DisplayText", T("Display Text"), T("The text representing the content, e.g. its Title."), DisplayProperty, RenderProperty ); }
public void Describe(DescribePropertyContext describe) { foreach (var part in _contentDefinitionManager.ListPartDefinitions()) { if (!part.Fields.Any()) { continue; } var descriptor = describe.For(part.Name + "ContentFields", T("{0} Content Fields", part.Name.CamelFriendly()), T("Content Fields for {0}", part.Name.CamelFriendly())); foreach (var field in part.Fields) { var localField = field; var localPart = part; var drivers = _contentFieldDrivers.Where(x => x.GetFieldInfo().Any(fi => fi.FieldTypeName == localField.FieldDefinition.Name)).ToList(); var membersContext = new DescribeMembersContext( (storageName, storageType, displayName, description) => { // look for a compatible field type editor IFieldTypeEditor fieldTypeEditor = _fieldTypeEditors.FirstOrDefault(x => x.CanHandle(storageType)); descriptor.Element( type: localPart.Name + "." + localField.Name + "." + storageName ?? "", name: new LocalizedString(localField.DisplayName + (displayName != null ? ":" + displayName.Text : "")), description: description ?? T("{0} property for {1}", storageName, localField.DisplayName), property: (context, contentItem) => Render(context, contentItem, fieldTypeEditor, storageName, storageType, localPart, localField), display: context => DisplayFilter(context, localPart, localField, storageName), form: _propertyFormater.GetForm(storageType) ); }); foreach (var driver in drivers) { driver.Describe(membersContext); } } } }