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


C# WellKnownType类代码示例

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


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

示例1: SetWellKnownTypeSignatureName

        private void SetWellKnownTypeSignatureName(WellKnownType wellKnownType, string mangledSignatureName)
        {
            var type = _compilation.TypeSystemContext.GetWellKnownType(wellKnownType);
            var typeNode = _compilation.NodeFactory.ConstructedTypeSymbol(type);

            _cppSignatureNames.Add(type, mangledSignatureName);
        }
开发者ID:justinvp,项目名称:corert,代码行数:7,代码来源:CppWriter.cs

示例2: SetWellKnownType

        internal void SetWellKnownType(WellKnownType wellKnownType)
        {
            TypeFlags flags;

            switch (wellKnownType)
            {
                case WellKnownType.Void:
                case WellKnownType.Boolean:
                case WellKnownType.Char:
                case WellKnownType.SByte:
                case WellKnownType.Byte:
                case WellKnownType.Int16:
                case WellKnownType.UInt16:
                case WellKnownType.Int32:
                case WellKnownType.UInt32:
                case WellKnownType.Int64:
                case WellKnownType.UInt64:
                case WellKnownType.IntPtr:
                case WellKnownType.UIntPtr:
                case WellKnownType.Single:
                case WellKnownType.Double:
                    flags = (TypeFlags)wellKnownType;
                    break;

                case WellKnownType.ValueType:
                case WellKnownType.Enum:
                    flags = TypeFlags.Class;
                    break;

                case WellKnownType.Nullable:
                    flags = TypeFlags.Nullable;
                    break;

                case WellKnownType.Object:
                case WellKnownType.String:
                case WellKnownType.Array:
                case WellKnownType.MulticastDelegate:
                case WellKnownType.Exception:
                    flags = TypeFlags.Class;
                    break;

                case WellKnownType.RuntimeTypeHandle:
                case WellKnownType.RuntimeMethodHandle:
                case WellKnownType.RuntimeFieldHandle:
                    flags = TypeFlags.ValueType;
                    break;

                default:
                    throw new ArgumentException();
            }

            _typeFlags = flags;
        }
开发者ID:mjp41,项目名称:corert,代码行数:53,代码来源:TypeDesc.cs

示例3: GetWellKnownType

 public override DefType GetWellKnownType(WellKnownType wellKnownType)
 {
     return _wellKnownTypes[(int)wellKnownType - 1];
 }
开发者ID:noahfalk,项目名称:corert,代码行数:4,代码来源:TestTypeSystemContext.cs

示例4: GetWellKnownType

        public override DefType GetWellKnownType(WellKnownType wellKnownType)
        {
            switch (wellKnownType)
            {
                case WellKnownType.Void:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(void).TypeHandle);

                case WellKnownType.Boolean:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Boolean).TypeHandle);

                case WellKnownType.Char:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Char).TypeHandle);

                case WellKnownType.SByte:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(SByte).TypeHandle);

                case WellKnownType.Byte:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Byte).TypeHandle);

                case WellKnownType.Int16:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Int16).TypeHandle);

                case WellKnownType.UInt16:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(UInt16).TypeHandle);

                case WellKnownType.Int32:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Int32).TypeHandle);

                case WellKnownType.UInt32:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(UInt32).TypeHandle);

                case WellKnownType.Int64:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Int64).TypeHandle);

                case WellKnownType.UInt64:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(UInt64).TypeHandle);

                case WellKnownType.IntPtr:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(IntPtr).TypeHandle);

                case WellKnownType.UIntPtr:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(UIntPtr).TypeHandle);

                case WellKnownType.Single:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Single).TypeHandle);

                case WellKnownType.Double:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Double).TypeHandle);

                case WellKnownType.ValueType:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(ValueType).TypeHandle);

                case WellKnownType.Enum:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Enum).TypeHandle);

                case WellKnownType.Nullable:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Nullable<>).TypeHandle);

                case WellKnownType.Object:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Object).TypeHandle);

                case WellKnownType.String:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(String).TypeHandle);

                case WellKnownType.Array:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Array).TypeHandle);

                case WellKnownType.MulticastDelegate:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(MulticastDelegate).TypeHandle);

                case WellKnownType.RuntimeTypeHandle:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeTypeHandle).TypeHandle);

                case WellKnownType.RuntimeMethodHandle:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeMethodHandle).TypeHandle);

                case WellKnownType.RuntimeFieldHandle:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeFieldHandle).TypeHandle);

                case WellKnownType.Exception:
                    return (DefType)ResolveRuntimeTypeHandle(typeof(Exception).TypeHandle);

                default:
                    throw new NotImplementedException();
            }
        }
开发者ID:nattress,项目名称:corert,代码行数:86,代码来源:TypeLoaderTypeSystemContext.cs

示例5: ImportStoreIndirect

 private void ImportStoreIndirect(WellKnownType wellKnownType)
 {
     ImportStoreIndirect(GetWellKnownType(wellKnownType));
 }
开发者ID:noahfalk,项目名称:corert,代码行数:4,代码来源:ILImporter.cs

示例6: WellKnownType

 public NamedTypeSymbol WellKnownType(WellKnownType wt)
 {
     NamedTypeSymbol wellKnownType = Compilation.GetWellKnownType(wt);
     Binder.ReportUseSiteDiagnostics(wellKnownType, Diagnostics, Syntax);
     return wellKnownType;
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:6,代码来源:SyntheticBoundNodeFactory.cs

示例7: TopLevel

 public TopLevel(ModuleSymbol module, ref MetadataTypeName fullName, WellKnownType wellKnownType)
     : this(module, ref fullName, (int)wellKnownType)
 {
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:MissingMetadataTypeSymbol.cs

示例8: ImportConvert

        private void ImportConvert(WellKnownType wellKnownType, bool checkOverflow, bool unsigned)
        {
            var op = _stack.Pop();

            TypeDesc type = GetWellKnownType(wellKnownType);

            PushTemp(GetStackValueKind(type));
            Append("(");
            Append(_writer.GetCppSignatureTypeName(type));
            Append(")");
            Append(op);
            AppendSemicolon();
        }
开发者ID:nguerrera,项目名称:corert,代码行数:13,代码来源:ILToCppImporter.cs

示例9: ImportLoadIndirect

 void ImportLoadIndirect(WellKnownType wellKnownType)
 {
     ImportLoadIndirect(GetWellKnownType(wellKnownType));
 }
开发者ID:niemyjski,项目名称:corert,代码行数:4,代码来源:ILImporter.cs

示例10: ImportLoadElement

 void ImportLoadElement(WellKnownType wellKnownType)
 {
     ImportLoadElement(GetWellKnownType(wellKnownType));
 }
开发者ID:niemyjski,项目名称:corert,代码行数:4,代码来源:ILImporter.cs

示例11: GetWellKnownType

 public override DefType GetWellKnownType(WellKnownType wellKnownType)
 {
     Debug.Assert(_wellKnownTypes != null, "Forgot to call SetSystemModule?");
     return _wellKnownTypes[(int)wellKnownType - 1];
 }
开发者ID:tijoytom,项目名称:corert,代码行数:5,代码来源:MetadataTypeSystemContext.cs

示例12: RootWellKnownType

 private void RootWellKnownType(WellKnownType wellKnownType, IRootingServiceProvider rootProvider)
 {
     var type = _context.GetWellKnownType(wellKnownType);
     rootProvider.AddCompilationRoot(type, "Enables CPP codegen");
 }
开发者ID:nattress,项目名称:corert,代码行数:5,代码来源:CppCodegenCompilation.cs

示例13: AddWellKnownType

 private void AddWellKnownType(WellKnownType wellKnownType, DependencyAnalysisFramework.DependencyAnalyzerBase<NodeFactory> graph)
 {
     var type = TypeSystemContext.GetWellKnownType(wellKnownType);
     var typeNode = ConstructedTypeSymbol(type);
     graph.AddRoot(typeNode, "Enables CPP codegen");
 }
开发者ID:krytarowski,项目名称:corert,代码行数:6,代码来源:CppCodegenNodeFactory.cs

示例14: SetWellKnownTypeSignatureName

 private void SetWellKnownTypeSignatureName(WellKnownType wellKnownType, string mangledSignatureName)
 {
     var type = _compilation.TypeSystemContext.GetWellKnownType(wellKnownType);
     _cppSignatureNames.Add(type, mangledSignatureName);
 }
开发者ID:xier2012,项目名称:corert,代码行数:5,代码来源:CppWriter.cs

示例15: TopLevelWithCustomErrorInfo

 public TopLevelWithCustomErrorInfo(ModuleSymbol module, ref MetadataTypeName emittedName, DiagnosticInfo errorInfo, WellKnownType typeId)
     : base(module, ref emittedName, typeId)
 {
     Debug.Assert(errorInfo != null);
     _errorInfo = errorInfo;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:6,代码来源:MissingMetadataTypeSymbol.cs


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