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
ファイル: AmfEndpointContext.cs プロジェクト: artema/DotAmf
        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
ファイル: AmfEncoder.cs プロジェクト: artema/DotAmf
        /// <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);
        }