/// <summary>
        /// Initializes a new instance of the <see cref="MediaTypeFormatter"/> class.
        /// </summary>
        protected MediaTypeFormatter()
        {
            SupportedMediaTypes = new MediaTypeHeaderValueCollection();
            SupportedEncodings  = new Collection <Encoding>();
#if !NETFX_CORE
            MediaTypeMappings = new Collection <MediaTypeMapping>();
#endif
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaTypeFormatter"/> class.
 /// </summary>
 protected MediaTypeFormatter()
 {
     _supportedMediaTypes = new List <MediaTypeHeaderValue>();
     SupportedMediaTypes  = new MediaTypeHeaderValueCollection(_supportedMediaTypes);
     _supportedEncodings  = new List <Encoding>();
     SupportedEncodings   = new Collection <Encoding>(_supportedEncodings);
     _mediaTypeMappings   = new List <MediaTypeMapping>();
     MediaTypeMappings    = new Collection <MediaTypeMapping>(_mediaTypeMappings);
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaTypeFormatter"/> class.
        /// </summary>
        protected MediaTypeFormatter()
        {
            _supportedMediaTypes = new List <MediaTypeHeaderValue>();
            SupportedMediaTypes  = new MediaTypeHeaderValueCollection(_supportedMediaTypes);
            _supportedEncodings  = new List <Encoding>();
            SupportedEncodings   = new Collection <Encoding>(_supportedEncodings);
#if !NETFX_CORE // No MediaTypeMappings in portable library
            _mediaTypeMappings = new List <MediaTypeMapping>();
            MediaTypeMappings  = new Collection <MediaTypeMapping>(_mediaTypeMappings);
#endif
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaTypeFormatter"/> class.
 /// </summary>
 protected MediaTypeFormatter()
 {
     SupportedMediaTypes = new MediaTypeHeaderValueCollection();
     SupportedEncodings  = new Collection <Encoding>();
     MediaTypeMappings   = new Collection <MediaTypeMapping>();
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="MediaTypeFormatter" /> class.
 /// </summary>
 protected MediaTypeFormatter()
 {
     SupportedMediaTypes = new MediaTypeHeaderValueCollection();
     SupportedEncodings  = new HashSet <Encoding>();
 }