Example #1
0
        public Type GetType(string className, bool throwOnError, bool ignoreCase)
        {
            TypeNameParser parser = TypeNameParser.Parse(className, throwOnError);

            if (parser.Error)
            {
                return(null);
            }
            if (parser.AssemblyName != null)
            {
                if (throwOnError)
                {
                    throw new ArgumentException("Type names passed to Module.GetType() must not specify an assembly.");
                }
                else
                {
                    return(null);
                }
            }
            TypeName typeName = TypeName.Split(TypeNameParser.Unescape(parser.FirstNamePart));
            Type     type     = ignoreCase
                                ? FindTypeIgnoreCase(typeName.ToLowerInvariant())
                                : FindType(typeName);

            if (type == null && __IsMissing)
            {
                throw new MissingModuleException((MissingModule)this);
            }
            return(parser.Expand(type, this, throwOnError, className, false, ignoreCase));
        }
Example #2
0
        public Type GetType(string className, bool throwOnError, bool ignoreCase)
        {
            if (ignoreCase)
            {
                throw new NotImplementedException();
            }
            TypeNameParser parser = TypeNameParser.Parse(className, throwOnError);

            if (parser.Error)
            {
                return(null);
            }
            if (parser.AssemblyName != null)
            {
                if (throwOnError)
                {
                    throw new ArgumentException("Type names passed to Module.GetType() must not specify an assembly.");
                }
                else
                {
                    return(null);
                }
            }
            return(parser.Expand(GetTypeImpl(parser.FirstNamePart), this.Assembly, throwOnError, className));
        }
Example #3
0
        public Type GetType(string className, bool throwOnError, bool ignoreCase)
        {
            if (ignoreCase)
            {
                throw new NotImplementedException();
            }
            TypeNameParser parser = TypeNameParser.Parse(className, throwOnError);

            if (parser.Error)
            {
                return(null);
            }
            if (parser.AssemblyName != null)
            {
                if (throwOnError)
                {
                    throw new ArgumentException("Type names passed to Module.GetType() must not specify an assembly.");
                }
                else
                {
                    return(null);
                }
            }
            Type type = FindType(TypeName.Split(TypeNameParser.Unescape(parser.FirstNamePart)));

            if (type == null && __IsMissing)
            {
                throw new MissingModuleException((MissingModule)this);
            }
            return(parser.Expand(type, this.Assembly, throwOnError, className));
        }
Example #4
0
        public Type GetType(string typeName, bool throwOnError)
        {
            TypeNameParser parser = TypeNameParser.Parse(typeName, throwOnError);

            if (parser.Error)
            {
                return(null);
            }
            if (parser.AssemblyName != null)
            {
                if (throwOnError)
                {
                    throw new ArgumentException("Type names passed to Assembly.GetType() must not specify an assembly.");
                }
                else
                {
                    return(null);
                }
            }
            return(parser.Expand(GetTypeImpl(parser.FirstNamePart), this, throwOnError, typeName));
        }