/// <inheritdoc /> protected override IFieldInfoData GenerateDescriptionsData() { this.currentExtractor = GetConcreteExtractor(this.CurrentState); var fieldDescriptions = this.GetDescriptions(this.currentExtractor); var root = this.GetFieldDescriptionHierarchy(fieldDescriptions); var data = new FieldInfoData(root); return(data); }
private static IFieldInfoExtractor GetConcreteExtractor(object itemsSource) { var genericList = itemsSource as IEnumerable; if (genericList != null) { IFieldInfoExtractor provider = GetDynamicObjectFieldExtractor(genericList); if (provider == null) { provider = new EnumerableFieldDescriptionsExtractor(genericList); } return(provider); } return(new EnumerableFieldDescriptionsExtractor(new List <object>())); }
/// <summary> /// Gets the <see cref="IDataFieldInfo"/> for the itemsSource. /// </summary> /// <returns>The <see cref="IEnumerable{IDataFieldInfo}"/> with all <see cref="IDataFieldInfo"/>s for this provider.</returns> protected virtual IEnumerable <IDataFieldInfo> GetDescriptions(IFieldInfoExtractor getter) { return(getter.GetDescriptions()); }