• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# System.RuntimeType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.RuntimeType的典型用法代码示例。如果您正苦于以下问题:C# RuntimeType类的具体用法?C# RuntimeType怎么用?C# RuntimeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RuntimeType类属于System命名空间,在下文中一共展示了RuntimeType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CilGenericType

        /// <summary>
        /// Initializes a new instance of the <see cref="CilGenericType"/> class.
        /// </summary>
        /// <param name="typeModule">The type module.</param>
        /// <param name="token">The token.</param>
        /// <param name="baseGenericType">Type of the base generic.</param>
        /// <param name="genericTypeInstanceSignature">The generic type instance signature.</param>
        public CilGenericType(ITypeModule typeModule, Token token, RuntimeType baseGenericType, GenericInstSigType genericTypeInstanceSignature)
            : base(baseGenericType.Module, token, baseGenericType.BaseType)
        {
            Debug.Assert(baseGenericType is CilRuntimeType);

            this.signature = genericTypeInstanceSignature;
            this.baseGenericType = baseGenericType as CilRuntimeType;
            this.InstantiationModule = typeModule;
            base.Attributes = baseGenericType.Attributes;
            base.Namespace = baseGenericType.Namespace;

            if (this.baseGenericType.IsNested)
            {
                // TODO: find generic type

                ;
            }

            // TODO: if this is a nested types, add enclosing type(s) into genericArguments first
            this.genericArguments = signature.GenericArguments;

            base.Name = GetName(typeModule);

            ResolveMethods();
            ResolveFields();

            this.containsOpenGenericArguments = CheckContainsOpenGenericParameters();
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:35,代码来源:CilGenericType.cs


示例2: RuntimeMember

 /// <summary>
 /// Initializes a new instance of <see cref="RuntimeMember"/>.
 /// </summary>
 /// <param name="token">Holds the token of this runtime metadata.</param>
 /// <param name="module">The module.</param>
 /// <param name="declaringType">The declaring type of the member.</param>
 /// <param name="attributes">Holds the attributes of the member.</param>
 protected RuntimeMember(int token, IMetadataModule module, RuntimeType declaringType, RuntimeAttribute[] attributes)
     : base(token)
 {
     this.module = module;
     this.declaringType = declaringType;
     this.attributes = attributes;
 }
开发者ID:hj1980,项目名称:Mosa,代码行数:14,代码来源:RuntimeMember.cs


示例3: CreateRuntimeInternal

        private static CloudRuntime CreateRuntimeInternal(RuntimeType runtimeType, string roleName, string rolePath)
        {
            CloudRuntime runtime;
            switch (runtimeType)
            {
                case RuntimeType.Null:
                    runtime = new NullCloudRuntime();
                    break;
                case RuntimeType.Cache:
                    runtime = new CacheCloudRuntime();
                    break;
                case RuntimeType.PHP:
                    runtime = new PHPCloudRuntime();
                    break;
                case RuntimeType.IISNode:
                    runtime = new IISNodeCloudRuntime();
                    break;
                case RuntimeType.Node:
                default:
                    runtime = new NodeCloudRuntime();
                    break;
            }

            runtime.Runtime = runtimeType;
            runtime.RoleName = roleName;
            runtime.FilePath = rolePath;
            return runtime;
        }
开发者ID:B-Rich,项目名称:azure-sdk-tools,代码行数:28,代码来源:CloudRuntime.cs


示例4: BuildMethodTable

        /// <summary>
        /// Builds the method table.
        /// </summary>
        /// <param name="type">The type.</param>
        public void BuildMethodTable(RuntimeType type)
        {
            IList<RuntimeMethod> methodTable = CreateMethodTable(type);

            // HINT: The method table is offset by a four pointers:
            // 1. interface dispatch table pointer
            // 2. type pointer - contains the type information pointer, used to realize object.GetType().
            // 3. interface bitmap
            // 4. parent type (if any)
            List<string> headerlinks = new List<string>();

            // 1. interface dispatch table pointer
            if (type.Interfaces.Count == 0)
                headerlinks.Add(null);
            else
                headerlinks.Add(type.FullName + @"$itable");

            // 2. type pointer - contains the type information pointer, used to realize object.GetType().
            headerlinks.Add(null); // TODO: GetType()

            // 3. interface bitmap
            if (type.Interfaces.Count == 0)
                headerlinks.Add(null);
            else
                headerlinks.Add(type.FullName + @"$ibitmap");

            // 4. parent type (if any)
            if (type.BaseType == null)
                headerlinks.Add(null);
            else
                headerlinks.Add(type.BaseType + @"$mtable");

            AskLinkerToCreateMethodTable(type.FullName + @"$mtable", methodTable, headerlinks);
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:38,代码来源:TypeLayoutStage.cs


示例5: CreateRuntimeInternal

        private static CloudRuntime CreateRuntimeInternal(RuntimeType runtimeType, string roleName, string rolePath)
        {
            CloudRuntime runtime;
            switch (runtimeType)
            {
                case RuntimeType.Null:
                    runtime = new NullCloudRuntime();
                    break;
                case RuntimeType.Cache:
                    //Scaffolding for cache is no longer supported
                    throw new NotSupportedException(Resources.CacheScaffoldingIsNotSupport);
                case RuntimeType.PHP:
                    runtime = new PHPCloudRuntime();
                    break;
                case RuntimeType.IISNode:
                    runtime = new IISNodeCloudRuntime();
                    break;
                case RuntimeType.Node:
                default:
                    runtime = new NodeCloudRuntime();
                    break;
            }

            runtime.Runtime = runtimeType;
            runtime.RoleName = roleName;
            runtime.FilePath = rolePath;
            return runtime;
        }
开发者ID:FrankSiegemund,项目名称:azure-powershell,代码行数:28,代码来源:CloudRuntime.cs


示例6: TestCaseMethodCompiler

 public TestCaseMethodCompiler(IAssemblyLinker linker, IArchitecture architecture, IMetadataModule module, RuntimeType type, RuntimeMethod method)
     : base(linker, architecture, module, type, method)
 {
     // Populate the pipeline
     this.Pipeline.AddRange(new IMethodCompilerStage[] {
         new DecodingStage(),
         new BasicBlockBuilderStage(),
         new OperandDeterminationStage(),
         new InstructionLogger(),
         //new ConstantFoldingStage(),
         new CILTransformationStage(),
         //new InstructionLogger(),
         //InstructionStatisticsStage.Instance,
         //new DominanceCalculationStage(),
         //new EnterSSA(),
         //new ConstantPropagationStage(),
         //new ConstantFoldingStage(),
         //new LeaveSSA(),
         new StackLayoutStage(),
         new PlatformStubStage(),
         new InstructionLogger(),
         //new BlockReductionStage(),
         new LoopAwareBlockOrderStage(),
         //new SimpleTraceBlockOrderStage(),
         //new ReverseBlockOrderStage(),  // reverse all the basic blocks and see if it breaks anything
         //new BasicBlockOrderStage()
         new CodeGenerationStage(),
         //new InstructionLogger(),
     });
 }
开发者ID:shanebrown99,项目名称:MOSA-Project,代码行数:30,代码来源:TestCaseMethodCompiler.cs


示例7: SimpleJitMethodCompiler

        public SimpleJitMethodCompiler(AssemblyCompiler compiler, ICompilationSchedulerStage compilationScheduler, RuntimeType type, RuntimeMethod method, Stream codeStream, ITypeSystem typeSystem)
            : base(compiler.Pipeline.FindFirst<IAssemblyLinker>(), compiler.Architecture, compilationScheduler, type, method, typeSystem, compiler.Pipeline.FindFirst<ITypeLayout>())
        {
            if (codeStream == null)
                throw new ArgumentNullException(@"codeStream");

            this.codeStream = codeStream;
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:8,代码来源:SimpleJitMethodCompiler.cs


示例8: RuntimeInspectionOnlyConstructedGenericType

 internal RuntimeInspectionOnlyConstructedGenericType(RuntimeType genericTypeDefinition, RuntimeType[] genericTypeArguments)
     : base(new ConstructedGenericTypeKey(genericTypeDefinition, genericTypeArguments))
 {
     // We know this is a nop since just passed the key to our base class. However, we do want this subclass to follow
     // the PrepareKey() protocol without relying on knowledge about the base class so we'll go by the book and call it
     // anyway so that our GetHashCode() method is justified in not calling it again.
     this.PrepareKey();
 }
开发者ID:noahfalk,项目名称:corert,代码行数:8,代码来源:RuntimeInspectionOnlyConstructedGenericType.cs


示例9: MethodCompiler

        public MethodCompiler(IAssemblyLinker linker, IArchitecture architecture, IMetadataModule module, RuntimeType type, RuntimeMethod method, Stream codeStream)
            : base(linker, architecture, module, type, method)
        {
            if (null == codeStream)
                throw new ArgumentNullException(@"codeStream");

            _codeStream = codeStream;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:8,代码来源:MethodCompiler.cs


示例10: CompilerGeneratedMethod

        /// <summary>
        /// Initializes a new instance of the <see cref="CompilerGeneratedMethod"/> class.
        /// </summary>
        /// <param name="module">The module.</param>
        /// <param name="name">The name of the method.</param>
        /// <param name="declaringType">Type of the declaring.</param>
        public CompilerGeneratedMethod(IMetadataModule module, string name, RuntimeType declaringType)
            : base(0, module, declaringType)
        {
            if (name == null)
                throw new ArgumentNullException(@"name");

            this.name = name;
            this.Parameters = new List<RuntimeParameter>();
        }
开发者ID:hj1980,项目名称:Mosa,代码行数:15,代码来源:LinkerGeneratedMethod.cs


示例11: CilRuntimeField

 /// <summary>
 /// Initializes a new instance of the <see cref="CilRuntimeField"/> class.
 /// </summary>
 /// <param name="module">The module.</param>
 /// <param name="field">The field.</param>
 /// <param name="offset">The offset.</param>
 /// <param name="rva">The rva.</param>
 /// <param name="declaringType">Type of the declaring.</param>
 public CilRuntimeField(IMetadataModule module, ref FieldRow field, IntPtr offset, IntPtr rva, RuntimeType declaringType)
     : base(module, declaringType)
 {
     this.nameIdx = field.NameStringIdx;
     this.signature = field.SignatureBlobIdx;
     base.Attributes = field.Flags;
     base.RVA = rva;
     //base.Offset = offset; ?
 }
开发者ID:hj1980,项目名称:Mosa,代码行数:17,代码来源:CilRuntimeField.cs


示例12: CilRuntimeField

 /// <summary>
 /// Initializes a new instance of the <see cref="CilRuntimeField"/> class.
 /// </summary>
 /// <param name="moduleTypeSystem">The module type system.</param>
 /// <param name="field">The field.</param>
 /// <param name="offset">The offset.</param>
 /// <param name="rva">The rva.</param>
 /// <param name="declaringType">Type of the declaring.</param>
 public CilRuntimeField(IModuleTypeSystem moduleTypeSystem, FieldRow field, uint offset, uint rva, RuntimeType declaringType)
     : base(moduleTypeSystem, declaringType)
 {
     this.nameIdx = field.NameStringIdx;
     this.signatureBlobIdx = field.SignatureBlobIdx;
     base.Attributes = field.Flags;
     base.RVA = rva;
     //base.Offset = offset; ?
 }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:17,代码来源:CilRuntimeField.cs


示例13: CilGenericType

        public CilGenericType(RuntimeType type, IMetadataModule referencingModule, GenericInstSigType genericTypeInstanceSignature, ISignatureContext signatureContext)
            : base(type.Token, type.Module)
        {
            this.signature = genericTypeInstanceSignature;
            this.signatureContext = signatureContext;
            this.signatureModule = referencingModule;

            this.Methods = this.GetMethods();
            this.Fields = this.GetFields();
        }
开发者ID:hj1980,项目名称:MOSA-Project,代码行数:10,代码来源:CilGenericType.cs


示例14: LinkerGeneratedMethod

        /// <summary>
        /// Initializes a new instance of the <see cref="LinkerGeneratedMethod"/> class.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="name">The name of the method.</param>
        /// <param name="declaringType">Type of the declaring.</param>
        public LinkerGeneratedMethod(IModuleTypeSystem typeSystem, string name, RuntimeType declaringType)
            : base(typeSystem, 0, declaringType)
        {
            if (name == null)
                throw new ArgumentNullException(@"name");

            this.name = name;
            this.signature = new MethodSignature(new SigType(CilElementType.Void), new SigType[0]);
            this.Parameters = new List<RuntimeParameter>();
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:16,代码来源:LinkerGeneratedMethod.cs


示例15: CilGenericMethod

 public CilGenericMethod(IModuleTypeSystem moduleTypeSystem, CilRuntimeMethod method, MethodSignature signature, RuntimeType declaringType)
     : base(moduleTypeSystem, method.Token, declaringType)
 {
     this.genericMethod = method;
     this.Signature = signature;
     this.Attributes = method.Attributes;
     this.ImplAttributes = method.ImplAttributes;
     this.Rva = method.Rva;
     this.Parameters = method.Parameters;
 }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:10,代码来源:CilGenericMethod.cs


示例16: CilGenericField

        public CilGenericField(RuntimeType declaringType, RuntimeField genericField, FieldSignature signature)
            : base(declaringType.Module, declaringType)
        {
            this.genericField = genericField;
            this.Signature = signature;

            // FIXME: RVA, Address of these?
            this.Attributes = genericField.Attributes;
            this.SetAttributes(genericField.CustomAttributes);
        }
开发者ID:hj1980,项目名称:MOSA-Project,代码行数:10,代码来源:CilGenericField.cs


示例17: InternalGetNameIfAvailable

        public sealed override String InternalGetNameIfAvailable(ref RuntimeType rootCauseForFailure)
        {
            RuntimeType shadowNamedType = ShadowNamedTypeIfAvailable;
            if (shadowNamedType != null)
                return shadowNamedType.Name;
            if (RuntimeAugments.Callbacks.IsReflectionBlocked(_runtimeTypeHandle))
                return BlockedRuntimeTypeNameGenerator.GetNameForBlockedRuntimeType(this);

            rootCauseForFailure = this;
            return null;
        }
开发者ID:noahfalk,项目名称:corert,代码行数:11,代码来源:RuntimeEENamedType.cs


示例18: CilGenericType

        public CilGenericType(IModuleTypeSystem moduleTypeSystem, RuntimeType genericType, GenericInstSigType genericTypeInstanceSignature)
            : base(moduleTypeSystem, genericType.Token)
        {
            this.signature = genericTypeInstanceSignature;
            this.genericArguments = signature.GenericArguments;

            this.genericType = genericType;

            base.Attributes = genericType.Attributes;

            this.Methods = this.GetMethods();
            this.Fields = this.GetFields();
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:13,代码来源:CilGenericType.cs


示例19: Equals

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public override bool Equals(RuntimeType other)
        {
            CilGenericType crt = other as CilGenericType;

            if (crt == null)
                return false;

            return
                this.moduleTypeSystem == crt.moduleTypeSystem &&
                genericType == crt.genericType &&
                signature == crt.signature &&
                SigType.Equals(this.genericArguments, crt.genericArguments) &&
                base.Equals(other);
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:21,代码来源:CilGenericType.cs


示例20: ScheduleTypeForCompilation

        public void ScheduleTypeForCompilation(RuntimeType type)
        {
            if (type == null)
                throw new ArgumentNullException(@"type");

            if (type.IsCompiled == true)
            {
                return;
            }

            if (type.IsGeneric == false)
            {
                Console.WriteLine(@"Scheduling type {0} for compilation.", type.FullName);
                Console.WriteLine(String.Format(@"Scheduling type {0} for compilation.", type.FullName));

                this.typeQueue.Enqueue(type);
                type.IsCompiled = true;
            }
        }
开发者ID:davidbjornn,项目名称:MOSA-Project,代码行数:19,代码来源:MethodCompilerSchedulerStage.cs



注:本文中的System.RuntimeType类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# System.RuntimeTypeHandle类代码示例发布时间:2022-05-26
下一篇:
C# System.RuntimeMethodHandleInternal类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap