当前位置: 首页>>代码示例>>C#>>正文


C# System.RuntimeType类代码示例

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


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


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