/// <summary>
        /// Gets a type deserializer builder for the given type.
        /// The deserializer is created when needed.
        /// </summary>
        public TypeDeserializerBuilder GetDeserializer(TypeDefinition type)
        {
            TypeDeserializerBuilder builder;
            if (typeDeserializerBuilders.TryGetValue(type, out builder))
                return builder;

            builder = new TypeDeserializerBuilder(type);
            typeDeserializerBuilders.Add(type, builder);
            return builder;
        }
        /// <summary>
        /// Gets a type deserializer builder for the given type.
        /// The deserializer is created when needed.
        /// </summary>
        public TypeDeserializerBuilder GetDeserializer(TypeDefinition type)
        {
            TypeDeserializerBuilder builder;

            if (typeDeserializerBuilders.TryGetValue(type, out builder))
            {
                return(builder);
            }

            builder = new TypeDeserializerBuilder(type);
            typeDeserializerBuilders.Add(type, builder);
            return(builder);
        }
        private void ProcessSerializers(ProxySerializationContext context)
        {
            if (InterfaceMethod.ReturnType != null)
            {
                var typeDefinition = InterfaceMethod.ReturnType.Resolve();
                if (typeDefinition.FullName != "System.Void")
                {
                    typeDeserializerBuilder = context.GetDeserializer(typeDefinition);
                    deserializerTypeIsArray = InterfaceMethod.ReturnType.IsArray;
                }
            }

            if (!string.IsNullOrEmpty(toSerializeArgument))
            {
                var parameter      = InterfaceMethod.Parameters.First(p => p.Name == toSerializeArgument);
                var typeDefinition = parameter.ParameterType.Resolve();
                typeSerializerBuilder = context.GetSerializer(typeDefinition);
                serializerTypeIsArray = parameter.ParameterType.IsArray;
            }
        }
        private void ProcessSerializers(ProxySerializationContext context)
        {
            if (InterfaceMethod.ReturnType != null)
            {
                var typeDefinition = InterfaceMethod.ReturnType.Resolve();
                if (typeDefinition.FullName != "System.Void")
                {
                    typeDeserializerBuilder = context.GetDeserializer(typeDefinition);
                    deserializerTypeIsArray = InterfaceMethod.ReturnType.IsArray;
                }
            }

            if (!string.IsNullOrEmpty(toSerializeArgument))
            {
                var parameter = InterfaceMethod.Parameters.First(p => p.Name == toSerializeArgument);
                var typeDefinition = parameter.ParameterType.Resolve();
                typeSerializerBuilder = context.GetSerializer(typeDefinition);
                serializerTypeIsArray = parameter.ParameterType.IsArray;
            }
        }