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


C# TypeCompilationState.GenerateTempNumber方法代码示例

本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.TypeCompilationState.GenerateTempNumber方法的典型用法代码示例。如果您正苦于以下问题:C# TypeCompilationState.GenerateTempNumber方法的具体用法?C# TypeCompilationState.GenerateTempNumber怎么用?C# TypeCompilationState.GenerateTempNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.CodeAnalysis.CSharp.TypeCompilationState的用法示例。


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

示例1: SynthesizedLambdaMethod

            internal SynthesizedLambdaMethod(NamedTypeSymbol containingType, MethodSymbol topLevelMethod, BoundLambda node, bool isStatic, TypeCompilationState compilationState)
                : base(containingType,
                       node.Symbol,
                       null,
                       node.SyntaxTree.GetReference(node.Body.Syntax),
                       node.Syntax.GetLocation(),
                       GeneratedNames.MakeLambdaMethodName(topLevelMethod.Name, compilationState.GenerateTempNumber()),
                       (containingType is LambdaFrame ? DeclarationModifiers.Internal : DeclarationModifiers.Private)
                            | (isStatic ? DeclarationModifiers.Static : 0)
                            | (node.Symbol.IsAsync ? DeclarationModifiers.Async : 0))
            {
                TypeMap typeMap;
                ImmutableArray<TypeParameterSymbol> typeParameters;
                LambdaFrame lambdaFrame;

                if (!topLevelMethod.IsGenericMethod)
                {
                    typeMap = TypeMap.Empty;
                    typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
                }
                else if ((object)(lambdaFrame = this.ContainingType as LambdaFrame) != null)
                {
                    typeMap = lambdaFrame.TypeMap;
                    typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
                }
                else
                {
                    typeMap = TypeMap.Empty.WithAlphaRename(topLevelMethod, this, out typeParameters);
                }

                AssignTypeMapAndTypeParameters(typeMap, typeParameters);
            }
开发者ID:nagyist,项目名称:roslyn,代码行数:32,代码来源:LambdaRewriter.Frame.cs

示例2: AsyncStruct

            public AsyncStruct(MethodSymbol method, TypeCompilationState compilationState)
                : base(method, GeneratedNames.MakeIteratorOrAsyncDisplayClassName(method.Name, compilationState.GenerateTempNumber()), TypeKind.Struct)
            {
                this.interfaces = ReadOnlyArray<NamedTypeSymbol>.CreateFrom(
                    compilationState.EmitModule.Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IAsyncStateMachine));

                this.constructor = new SynthesizedInstanceConstructor(this);
            }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:8,代码来源:AsyncStruct.cs

示例3: IteratorClass

            public IteratorClass(MethodSymbol method, bool isEnumerable, TypeSymbol elementType, TypeCompilationState compilationState)
                : base(method, GeneratedNames.MakeIteratorOrAsyncDisplayClassName(method.Name, compilationState.GenerateTempNumber()), TypeKind.Class)
            {
                this.ElementType = TypeMap.SubstituteType(elementType);
                var interfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance();
                if (isEnumerable)
                {
                    interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(ElementType));
                    interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_IEnumerable));
                }

                interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerator_T).Construct(ElementType));
                interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_IDisposable));
                interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_IEnumerator));
                this.interfaces = interfaces.ToImmutableAndFree();

                this.constructor = new IteratorConstructor(this);
            }
开发者ID:riversky,项目名称:roslyn,代码行数:18,代码来源:IteratorClass.cs

示例4: LambdaFrameLocalSymbol

 internal LambdaFrameLocalSymbol(MethodSymbol containingMethod, TypeSymbol type, TypeCompilationState compilationState)
     : base(containingMethod, type, GeneratedNames.MakeLambdaDisplayClassLocalName(compilationState.GenerateTempNumber()), declarationKind: LocalDeclarationKind.CompilerGeneratedLambdaDisplayClassLocal)
 {
 }
开发者ID:nagyist,项目名称:roslyn,代码行数:4,代码来源:LambdaRewriter.Frame.cs

示例5: LambdaFrame

 internal LambdaFrame(MethodSymbol topLevelMethod, TypeCompilationState compilationState)
     : base(topLevelMethod, GeneratedNames.MakeAnonymousDisplayClassName(compilationState.GenerateTempNumber()), TypeKind.Class)
 {
     this.constructor = new SynthesizedInstanceConstructor(this);
 }
开发者ID:nagyist,项目名称:roslyn,代码行数:5,代码来源:LambdaRewriter.Frame.cs

示例6: LambdaFrame

 internal LambdaFrame(MethodSymbol topLevelMethod, TypeCompilationState compilationState)
     : base(GeneratedNames.MakeAnonymousDisplayClassName(compilationState.GenerateTempNumber()), topLevelMethod)
 {
     this.topLevelMethod = topLevelMethod;
     this.constructor = new LambdaFrameConstructor(this);
 }
开发者ID:pheede,项目名称:roslyn,代码行数:6,代码来源:LambdaFrame.cs


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