/// <summary>
        /// Creates a new instace of the <see cref="CustomTextMessageEncoder" /> class.
        /// </summary>
        /// <param name="factory">Factory to use</param>
        public CustomTextMessageEncoder(CustomTextMessageEncoderFactory factory)
        {
            this.factory = factory;

            this.writerSettings = new XmlWriterSettings { Encoding = Encoding.GetEncoding(factory.CharSet) };
            this.contentType = string.Format("{0}; charset={1}", this.factory.MediaType, this.writerSettings.Encoding.HeaderName);
            this.transformers = this.factory.Transformers;
        }
Exemple #2
0
        /// <summary>
        /// Creates a new instace of the <see cref="CustomTextMessageEncoder" /> class.
        /// </summary>
        /// <param name="factory">Factory to use</param>
        public CustomTextMessageEncoder(CustomTextMessageEncoderFactory factory)
        {
            this.factory = factory;

            this.writerSettings = new XmlWriterSettings {
                Encoding = Encoding.GetEncoding(factory.CharSet)
            };
            this.contentType  = string.Format("{0}; charset={1}", this.factory.MediaType, this.writerSettings.Encoding.HeaderName);
            this.transformers = this.factory.Transformers;
        }