Example #1
0
        public Type GetRegistratedType(string typeName)
        {
            //Type requestedType=null;
            //string[] typeNameComponents = typeName.Split('.');
            //int i = 0;
            //int maxIterations = _registratedTypes.Select(t => t.FullName.Split('.')).Max(n => n.Length);
            //while (requestedType==null && i<=maxIterations)
            //{
            //    requestedType = _registratedTypes.SingleOrDefault(t => t.FullName.Split('.').Skip(i).SequenceEqual(typeNameComponents,StringComparer.OrdinalIgnoreCase));
            //    i++;
            //}
            //return requestedType;

            return(_registratedTypes.SingleOrDefault(t => TypeNameCompareHelper.IsStringMatchesTypeName(typeName, t.FullName)));
        }
Example #2
0
 public IEnumerable <Type> GetTypesInNamespace(string @namespace)
 {
     return(_registratedTypes.Where(t => TypeNameCompareHelper.IsStringMatchesTypeName(@namespace, t.Namespace)));
 }