示例#1
0
        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 }));
        }
示例#2
0
        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);
        }