Esempio n. 1
0
        /// <summary>
        /// Gets the string value of the message. The <paramref name="encoding"/> parameter
        /// is ignored.
        /// </summary>
        /// <param name="encoding">Ignored.</param>
        /// <returns>
        /// The string value of the message.
        /// </returns>
        public string GetStringValue(Encoding encoding)
        {
            var stringValue = RawStringValue;

            if (_namedPipeMessage.Headers.ContainsKey(HeaderName.CompressedPayload) &&
                _namedPipeMessage.Headers[HeaderName.CompressedPayload] == "true")
            {
                stringValue = MessageCompression.Decompress(stringValue);
            }

            return(stringValue);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the string value of the message.
        /// </summary>
        /// <param name="encoding">The encoding to use. Ignored.</param>
        /// <returns>The string value of the message.</returns>
        public string GetStringValue(Encoding encoding)
        {
            var stringValue = RawStringValue;

            if (_message.MessageAttributes.ContainsKey(HeaderName.CompressedPayload) &&
                _message.MessageAttributes[HeaderName.CompressedPayload].StringValue == "true")
            {
                stringValue = MessageCompression.Decompress(stringValue);
            }

            return(stringValue);
        }