Пример #1
0
        public void TypeDescriptorUtils_GetPropertyOnDataSet()
        {
            var type  = typeof(GridViewDataSet <ITestDataSource>);
            var value = TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(type));

            Assert.IsNotNull(value);
            Assert.AreEqual("ITestDataSource", value.Name);
        }
Пример #2
0
        public static Type?GetEnumerableType(this Type collectionType)
        {
            var result = TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(collectionType));

            if (result == null)
            {
                return(null);
            }
            return(ResolvedTypeDescriptor.ToSystemType(result));
        }
Пример #3
0
 public override ITypeDescriptor GetChildDataContextType(ITypeDescriptor dataContext, IDataContextStack controlContextStack, IAbstractControl control, IPropertyDescriptor property = null)
 {
     return(TypeDescriptorUtils.GetCollectionItemType(dataContext));
 }
Пример #4
0
        public void TypeDescriptorUtils_GetPropertyOnObject()
        {
            var type = typeof(object);

            TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(type));
        }