コード例 #1
0
 /// <summary>
 /// This is the same implementation of ToString from Java's AbstractMap
 /// (the default implementation for all dictionaries), plus the ability
 /// to specify culture for formatting of nested numbers and dates. Note that
 /// this overload will change the culture of the current thread.
 /// </summary>
 public static string ToString <TKey, TValue>(IDictionary <TKey, TValue> dictionary, CultureInfo culture)
 {
     using (var context = new CultureContext(culture))
     {
         return(ToString(dictionary));
     }
 }
コード例 #2
0
 /// <summary>
 /// This is a helper method that assists with recursively building
 /// a string of the current collection and all nested collections, plus the ability
 /// to specify culture for formatting of nested numbers and dates. Note that
 /// this overload will change the culture of the current thread.
 /// </summary>
 public static string ToString(object obj, CultureInfo culture)
 {
     using (var context = new CultureContext(culture))
     {
         return(ToString(obj));
     }
 }
コード例 #3
0
 /// <summary>
 /// This is the same implementation of ToString from Java's AbstractCollection
 /// (the default implementation for all sets and lists), plus the ability
 /// to specify culture for formatting of nested numbers and dates. Note that
 /// this overload will change the culture of the current thread.
 /// </summary>
 public static string ToString <T>(ICollection <T> collection, CultureInfo culture)
 {
     using (var context = new CultureContext(culture))
     {
         return(ToString(collection));
     }
 }