Beispiel #1
0
 public static string Get(T value)
 {
     if (!map.TryGetValue(value, out string str))
     {
         str = value.ToString();
         map.Add(value, str);
     }
     return(str);
 }
Beispiel #2
0
 static AttributedTypeCache()
 {
     foreach (var type in Meta.kumaAsms.AllTypes())
     {
         foreach (var attr in type.GetCustomAttributes())
         {
             if (!catalog.TryGetValue(attr.GetType(), out UnorderedSet <TypeKey> types))
             {
                 types = new UnorderedSet <TypeKey>(4);
                 catalog.Add(attr.GetType(), types);
             }
             types.AddIfNone(type);
         }
     }
 }
Beispiel #3
0
 public bool TryGetKey(TValue value, out TKey key)
 {
     return(valueToKey.TryGetValue(value, out key));
 }
Beispiel #4
0
 public bool TryGetValue(TKey key, out TValue value)
 {
     return(keyToValue.TryGetValue(key, out value));
 }