示例#1
0
        /// <summary>
        /// Initializes or retrieves from the cache <see cref="_languageCodeSuggestions"/>
        /// </summary>
        /// <returns>
        /// List of language code suggestions
        /// </returns>
        internal static IEnumerable <KeyValuePair <string, DType> > GetLanguageCodeSuggestions()
        {
            if (_languageCodeSuggestions == null)
            {
                Interlocked.CompareExchange(
                    ref _languageCodeSuggestions,
                    TexlStrings.SupportedDateTimeLanguageCodes(null).Split(new[] { ',' }).Select(locale => new KeyValuePair <string, DType>(locale, DType.String)),
                    null);
            }

            return(_languageCodeSuggestions);
        }
示例#2
0
        protected override void FormatCore(StringBuilder sb)
        {
            Contracts.AssertValue(sb);

            sb.AppendFormat(CultureInfo.CurrentCulture, TexlStrings.FormatSpan_Min_Lim(), Tok.Span.Min, Tok.Span.Lim);

            if (Node != null)
            {
                sb.AppendFormat(CultureInfo.CurrentCulture, TexlStrings.InfoNode_Node(), Node.ToString());
            }
            else
            {
                sb.AppendFormat(CultureInfo.CurrentCulture, TexlStrings.InfoTok_Tok(), Tok.ToString());
            }

            sb.AppendFormat(CultureInfo.CurrentCulture, TexlStrings.FormatErrorSeparator());
            base.FormatCore(sb);
        }