Example #1
0
        [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
        private static void GetTokenHelper(String typeStr)
        {
            new PermissionSet(PermissionState.Unrestricted).Assert();
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
            Type           type      = RuntimeTypeHandle.GetTypeByName(typeStr.Trim().Replace('\'', '\"'), ref stackMark);

            Contract.Assert((type == null) || (type.Module.Assembly != System.Reflection.Assembly.GetExecutingAssembly()) || (typeStr.IndexOf("mscorlib", StringComparison.Ordinal) < 0),
                            "We should not go through this path for mscorlib based permissions");
        }
Example #2
0
        public Type GetType(string typeName)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException("typeName");
            }
            StackCrawlMark stackCrawlMark = StackCrawlMark.LookForMyCaller;

            return(RuntimeTypeHandle.GetTypeByName(typeName, false, false, false, ref stackCrawlMark, this.m_contextObject, false));
        }
Example #3
0
        public Type GetType(String typeName)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException("typeName");
            }
            Contract.EndContractBlock();

            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            return(RuntimeTypeHandle.GetTypeByName(
                       typeName, false /*throwOnError*/, false /*ignoreCase*/, false /*reflectionOnly*/, ref stackMark, m_contextObject, false /*loadTypeFromPartialName*/));
        }