/// <inheritdoc /> public override IASSourceMapper GetASSourceMapper(ASSourceMappingDescriptor descriptor) { if ((descriptor.SourceKind == ASTypeKind.Array || descriptor.SourceKind == ASTypeKind.ByteArray) && (descriptor.SourceContentFlags & ASValueContentFlags.HasDynamicProperties) == 0) { Type[] genericTypeArgs = MappingUtils.GetGenericCollectionTypeArgs(descriptor.TargetNativeType); if (genericTypeArgs != null) { return((IASSourceMapper)MappingUtils.InvokeGenericMethod(genericTypeArgs, getMapperInstance, new object[] { descriptor.TargetNativeType })); } } return(null); }
/// <inheritdoc /> public override IASTargetMapper GetASTargetMapper(ASTargetMappingDescriptor descriptor) { // Note: We don't want to map arrays or dictionaries here. Leave that up to a // specialized implementation instead. if (!descriptor.SourceNativeType.IsArray && !MappingUtils.IsGenericDictionary(descriptor.SourceNativeType)) { Type[] genericTypeArgs = MappingUtils.GetGenericCollectionTypeArgs(descriptor.SourceNativeType); if (genericTypeArgs != null) { return((IASTargetMapper)MappingUtils.InvokeGenericMethod(genericTypeArgs, getMapperInstance, new object[] { null })); } } return(null); }