public static string Get(T value) { if (!map.TryGetValue(value, out string str)) { str = value.ToString(); map.Add(value, str); } return(str); }
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); } } }
public bool TryGetKey(TValue value, out TKey key) { return(valueToKey.TryGetValue(value, out key)); }
public bool TryGetValue(TKey key, out TValue value) { return(keyToValue.TryGetValue(key, out value)); }