internal static System.Type GetBaseType(PropertyInfo property, object owner, IServiceProvider serviceProvider) { if (owner == null) { throw new ArgumentNullException("owner"); } if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (property == null) { return(null); } IDynamicPropertyTypeProvider provider = owner as IDynamicPropertyTypeProvider; if (provider != null) { System.Type propertyType = provider.GetPropertyType(serviceProvider, property.Name); if (propertyType != null) { return(propertyType); } } return(property.PropertyType); }
internal static Type GetBaseType(IServiceProvider serviceProvider, PropertyValidationContext validationContext) { Type propertyType = null; if (validationContext.Property is PropertyInfo) { return(Helpers.GetBaseType(validationContext.Property as PropertyInfo, validationContext.PropertyOwner, serviceProvider)); } if (validationContext.Property is DependencyProperty) { DependencyProperty property = validationContext.Property as DependencyProperty; if (property == null) { return(propertyType); } if (propertyType == null) { IDynamicPropertyTypeProvider propertyOwner = validationContext.PropertyOwner as IDynamicPropertyTypeProvider; if (propertyOwner != null) { propertyType = propertyOwner.GetPropertyType(serviceProvider, property.Name); } } if (propertyType == null) { propertyType = property.PropertyType; } } return(propertyType); }
internal static AccessTypes GetAccessType(IServiceProvider serviceProvider, PropertyValidationContext validationContext) { AccessTypes read = AccessTypes.Read; if (validationContext.Property is PropertyInfo) { return(Helpers.GetAccessType(validationContext.Property as PropertyInfo, validationContext.PropertyOwner, serviceProvider)); } if (validationContext.Property is DependencyProperty) { IDynamicPropertyTypeProvider propertyOwner = validationContext.PropertyOwner as IDynamicPropertyTypeProvider; if (propertyOwner != null) { read = propertyOwner.GetAccessType(serviceProvider, ((DependencyProperty)validationContext.Property).Name); } } return(read); }
internal static Type GetBaseType(PropertyDescriptor property, object owner, IServiceProvider serviceProvider) { Type propertyType = null; owner.GetType(); if (owner != null) { IDynamicPropertyTypeProvider provider = owner as IDynamicPropertyTypeProvider; if (provider != null) { propertyType = provider.GetPropertyType(serviceProvider, property.Name); } } if (propertyType == null) { propertyType = property.PropertyType; } return(propertyType); }
internal static AccessTypes GetAccessType(PropertyInfo property, object owner, IServiceProvider serviceProvider) { if (owner == null) { throw new ArgumentNullException("owner"); } if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (property != null) { IDynamicPropertyTypeProvider provider = owner as IDynamicPropertyTypeProvider; if (provider != null) { return(provider.GetAccessType(serviceProvider, property.Name)); } } return(AccessTypes.Read); }