示例#1
0
        /// <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);
        }
示例#2
0
        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>()));
        }
示例#3
0
 /// <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());
 }