示例#1
0
 public static void EnsureDictionary <TKey, TValue>()
 {
     Ensure(() =>
     {
         var a = new Dictionary <TKey, TValue>();
         FormatterCache <Dictionary <TKey, TValue> > .Register(new DictionaryFormatter <TKey, TValue>());
     });
 }
示例#2
0
 public static void EnsureList <T>() where T : new()
 {
     Ensure(() =>
     {
         var a = new List <T>();
         FormatterCache <T> .Register(new ObjectFormatter <T>());
         FormatterCache <T[]> .Register(new ArrayFormatter <T>());
         FormatterCache <List <T> > .Register(new ListFormatter <T>());
     });
 }