/// <summary>
 ///    Similar to System.String.Format, composes a new MulticulturalString object
 ///    based on a format string and inserts.
 /// </summary>
 /// <remarks>
 ///    If any of the inserts are MulticulturalString objects or IFormattable, then
 ///    those portions of the resulting MulticulturalString will also be rendered
 ///    in a culture-specific way.
 /// </remarks>
 public static MulticulturalString Format(MulticulturalString mcsFmt, params object[] inserts)
 {
     return(new MulticulturalString((ci) =>
     {
         string fmt = mcsFmt.ToCulture(ci);
         object[] cultureSpecificInserts = InsertsToCulture(inserts, ci);
         return String.Format(CultureInfo.CurrentCulture, fmt, cultureSpecificInserts);
     }));
 }
 /// <summary>
 ///    Similar to System.String.Format, composes a new MulticulturalString object
 ///    based on a format string and inserts.
 /// </summary>
 /// <remarks>
 /// <para>
 ///    If any of the inserts are MulticulturalString objects or IFormattable, then
 ///    those portions of the resulting MulticulturalString will also be rendered
 ///    in a culture-specific way.
 /// </para>
 /// <para>
 ///    The IFormatProvider could be CultureInfo.CurrentCulture, or some other
 ///    settings that control how dates, numbers, currency, etc. are formatted,
 ///    regardless of the language the strings are in.
 /// </para>
 /// </remarks>
 public static MulticulturalString Format(IFormatProvider fmtProvider,
                                          MulticulturalString mcsFmt,
                                          params object[] inserts)
 {
     return(new MulticulturalString((ci) =>
     {
         string fmt = mcsFmt.ToCulture(ci);
         object[] cultureSpecificInserts = InsertsToCulture(inserts, ci);
         return String.Format(fmtProvider, fmt, cultureSpecificInserts);
     }));
 }
Esempio n. 3
0
        } // end _WriteToEventProvider()

        public static void Trace(MulticulturalString message)
        {
            Trace(message.ToCulture(CultureInfo.InvariantCulture));
        }