Exemplo n.º 1
0
        private static void AddType(Type type)
        {
            string shortName = type.Name;

            if (TypeMap.ContainsKey(shortName))
            {
                shortName = type.FullName;
                if (TypeMap.ContainsKey(shortName))
                {
                    return;
                }
            }
            ShortNames.Add(type, shortName);
            TypeMap.Add(shortName, type);
            if (!type.IsGenericType)
            {
                return;
            }
            GenericTypeMap.Add(shortName.Replace("`1", ""), type);
            GenericShortNames.Add(type, shortName.Replace("`1", ""));
        }
Exemplo n.º 2
0
 internal bool IsMatch(string name)
 {
     return
         (ShortNames.Contains(name, StringComparer.Ordinal) ||
          LongNames.Contains(name, StringComparer.Ordinal));
 }