public void Map(Type sourceType, object source, Type targetType, object target)
{
foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(target))
{
PropertyDescriptor t1 = propertyDescriptor;
IEnumerable<PropertyWithComponent> source1 = UberFlatter.Flat(propertyDescriptor.Name, source);
if (source1.Count() != 0)
{
PropertyWithComponent propertyWithComponent = source1.First();
if (propertyWithComponent != null)
{
object sourcePropertyValue = propertyWithComponent.Property.GetValue(propertyWithComponent.Component);
object targetValue = GetTargetValue(propertyWithComponent.Property.PropertyType, sourcePropertyValue, propertyDescriptor.PropertyType);
propertyDescriptor.SetValue(target, targetValue);
}
}
}
}