예제 #1
0
        public Type GetTypeSpecified(CILProgramInstance programInstance)
        {
            if (Type != null)
            {
                return(Type.GetRuntimeType(programInstance));
            }

            if (ClassName != null)
            {
                var customType = programInstance.GetCustomType(ClassName);
                if (customType != null)
                {
                    return(customType);
                }

                var reflectedAssembly = Assembly.Load(ClassName.AssemblyName);
                return(reflectedAssembly.GetType(ClassName.ClassName));
            }

            throw new ArgumentException("Cannot get type specified.");
        }
예제 #2
0
        public Type GetRuntimeType(CILProgramInstance programInstance)
        {
            if (SimpleType != null)
            {
                return(SimpleType);
            }

            if (ClassName != null)
            {
                var customType = programInstance.GetCustomType(ClassName);
                if (customType != null)
                {
                    return(customType);
                }

                var reflectedAssembly = Assembly.Load(ClassName.AssemblyName);
                return(reflectedAssembly.GetType(ClassName.ClassName));
            }

            throw new NotImplementedException("Complex types are not supported yet.");
        }