private void AnalyzeAndValidateProperty(IPropertyInformation propertyInformation, string propertyIdentifier) { if (!_typeConversionProvider.CanConvert(propertyInformation.GetType(), typeof(PropertyInfo))) { return; } var property = (PropertyInfo)_typeConversionProvider.Convert(propertyInformation.GetType(), typeof(PropertyInfo), propertyInformation); var isMixinProperty = !property.DeclaringType.IsAssignableFrom(_baseType); var getMethod = property.GetGetMethod(true); var setMethod = property.GetSetMethod(true); if (getMethod != null) { ValidateAccessor(property, getMethod, isMixinProperty, "get accessor"); } if (setMethod != null) { ValidateAccessor(property, setMethod, isMixinProperty, "set accessor"); } if (!isMixinProperty) { _properties.Add(new Tuple <PropertyInfo, string> (property, propertyIdentifier)); } }
public static PropertyInfo ConvertToRuntimePropertyInfo(this IPropertyInformation propertyInformation) { ArgumentUtility.CheckNotNull("propertyInformation", propertyInformation); var propertyInfo = AsRuntimePropertyInfo(propertyInformation); if (propertyInfo == null) { throw new InvalidOperationException( string.Format( "The property '{0}' cannot be converted to a runtime property because no conversion is registered for '{1}'.", propertyInformation.Name, propertyInformation.GetType().Name)); } return(propertyInfo); }