public void TypeDescriptorUtils_GetPropertyOnDataSet() { var type = typeof(GridViewDataSet <ITestDataSource>); var value = TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(type)); Assert.IsNotNull(value); Assert.AreEqual("ITestDataSource", value.Name); }
public static Type?GetEnumerableType(this Type collectionType) { var result = TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(collectionType)); if (result == null) { return(null); } return(ResolvedTypeDescriptor.ToSystemType(result)); }
public override ITypeDescriptor GetChildDataContextType(ITypeDescriptor dataContext, IDataContextStack controlContextStack, IAbstractControl control, IPropertyDescriptor property = null) { return(TypeDescriptorUtils.GetCollectionItemType(dataContext)); }
public void TypeDescriptorUtils_GetPropertyOnObject() { var type = typeof(object); TypeDescriptorUtils.GetCollectionItemType(new ResolvedTypeDescriptor(type)); }