protected void AddPropertiesFromType(Type targetType)
{
Debug.Assert(targetType != null);
if (targetType == null)
{
throw new ArgumentNullException("targetType");
}
// If the type is not COM visible, we do not expose any of the properties
if (!IsComVisible(targetType))
return;
// Add all properties being ComVisible and AutomationVisible
var propertyInfos = targetType.GetProperties();
foreach (var propertyInfo in propertyInfos)
{
if (!IsInMap(propertyInfo) && IsComVisible(propertyInfo) && IsAutomationVisible(propertyInfo))
{
AddProperty(propertyInfo);
}
}
}