/// <summary>
 ///     Initializes a new instance of the <see cref="MessageFormatter" /> class.
 /// </summary>
 /// <param name="patternParser">
 ///     The pattern parser.
 /// </param>
 /// <param name="library">
 ///     The library.
 /// </param>
 /// <param name="useCache">
 ///     if set to <c>true</c> uses the cache.
 /// </param>
 /// <param name="locale">
 ///     The locale to use. Formatters may need this.
 /// </param>
 internal MessageFormatter(
     IPatternParser patternParser,
     IFormatterLibrary library,
     bool useCache,
     string locale = "en")
 {
     this.patternParser = patternParser ?? throw new ArgumentNullException("patternParser");
     this.library       = library ?? throw new ArgumentNullException("library");
     this.Locale        = locale;
     if (useCache)
     {
         this.cache = new ConcurrentDictionary <string, IFormatterRequestCollection>();
     }
 }
        /// <summary>
        ///     Initializes a new instance of the <see cref="MessageFormatter" /> class.
        /// </summary>
        /// <param name="patternParser">
        ///     The pattern parser.
        /// </param>
        /// <param name="library">
        ///     The library.
        /// </param>
        /// <param name="useCache">
        ///     if set to <c>true</c> uses the cache.
        /// </param>
        /// <param name="locale">
        ///     The locale to use. Formatters may need this.
        /// </param>
        internal MessageFormatter(
            IPatternParser patternParser, 
            IFormatterLibrary library, 
            bool useCache, 
            string locale = "en")
        {
            if (patternParser == null)
            {
                throw new ArgumentNullException("patternParser");
            }

            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            this.patternParser = patternParser;
            this.library = library;
            this.Locale = locale;
            if (useCache)
            {
                this.cache = new Dictionary<string, IFormatterRequestCollection>();
            }
        }