Пример #1
0
        public override DmdType GetType(string typeName, DmdGetTypeOptions options)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException(nameof(typeName));
            }

            var resolver = new TypeDefResolver(this, (options & DmdGetTypeOptions.IgnoreCase) != 0);
            var type     = DmdTypeNameParser.Parse(resolver, typeName);

            if ((object)type != null)
            {
                return(appDomain.Intern(type, DmdMakeTypeOptions.NoResolve));
            }

            if ((options & DmdGetTypeOptions.ThrowOnError) != 0)
            {
                throw new TypeNotFoundException(typeName);
            }
            return(null);
        }