static ValueSerializer BuildCompoundValueSerializer(Type compoundType) { var valueTypes = compoundType.GenericTypeArguments; var valueSerializers = valueTypes.Select( t => Instance(t)); return((ValueSerializer)Activator.CreateInstance( CompoundValueSerializer.GetGenericTypeWithTypes(valueTypes), new object [] { valueSerializers })); }
static ValueSerializer BuildCompoundValueSerializer(Type compoundType) { var valueTypes = compoundType.GenericTypeArguments; var valueSerializers = valueTypes.Select( t => Instance(t)); var serializerConstructor = CompoundValueSerializer.GetGenericConstructorWithTypes(valueTypes); var serializer = serializerConstructor.Invoke(new object[] { valueSerializers }); return((ValueSerializer)serializer); }