Serializes objects to the Action Message Format (AMF) and deserializes AMF data to objects.
This class is thread-safe and is expensive to instantiate.
Inheritance: System.Runtime.Serialization.XmlObjectSerializer
示例#1
0
        public AmfEndpointContext(ServiceEndpoint endpoint)
        {
            if (endpoint == null) throw new ArgumentNullException("endpoint");

            _contracts = new List<Type>();
            ResolveContracts(endpoint);

            ServiceEndpoint = endpoint;
            AmfSerializer = new DataContractAmfSerializer(typeof(AmfPacket), _contracts);
        }
示例#2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="encodingOptions">AMF encoding options.</param>
        public AmfEncoder(AmfEncodingOptions encodingOptions)
        {
            //Construct the default content type string
            _contentType = string.Format(
                "{0}; charset={1}",
                AmfEncoderFactory.DefaultAmfMediaType,
                AmfEncoderFactory.DefaultAmfCharSet
            );

            _serializer = new DataContractAmfSerializer(typeof(AmfPacket), encodingOptions);
        }