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;
            }
        }
Example #2
0
        /// <summary>
        /// Create all internal structures.
        /// </summary>
        public void Create(ProxySerializationContext context)
        {
            foreach (var property in type.Properties)
            {
                if (!Ignore(property))
                {
                    var builder       = context.GetSerializer(property.PropertyType.Resolve());
                    var builderHelper = new SerializerBuilderHelper
                    {
                        TypeSerializerBuilder = builder,
                        PropertyName          = property.Name
                    };

                    FillBuilderHelper(type, property, builderHelper);

                    builders.Add(property.Name, builderHelper);
                }
            }

            foreach (var field in type.Fields)
            {
                //Data...
            }
        }
        /// <summary>
        /// Create all internal structures.
        /// </summary>
        public void Create(ProxySerializationContext context)
        {
            foreach (var property in type.Properties)
            {
                if (!Ignore(property))
                {
                    var builder = context.GetSerializer(property.PropertyType.Resolve());
                    var builderHelper = new SerializerBuilderHelper
                        {
                            TypeSerializerBuilder = builder,
                            PropertyName = property.Name
                        };

                    FillBuilderHelper(type, property, builderHelper);

                    builders.Add(property.Name, builderHelper);
                }
            }

            foreach (var field in type.Fields)
            {
                //Data...
            }
        }
        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;
            }
        }