當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。