本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax类的典型用法代码示例。如果您正苦于以下问题:C# ArrowExpressionClauseSyntax类的具体用法?C# ArrowExpressionClauseSyntax怎么用?C# ArrowExpressionClauseSyntax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrowExpressionClauseSyntax类属于Microsoft.CodeAnalysis.CSharp.Syntax命名空间,在下文中一共展示了ArrowExpressionClauseSyntax类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateAccessorSymbol
public static SourcePropertyAccessorSymbol CreateAccessorSymbol(
NamedTypeSymbol containingType,
SourcePropertySymbol property,
DeclarationModifiers propertyModifiers,
string propertyName,
ArrowExpressionClauseSyntax syntax,
PropertySymbol explicitlyImplementedPropertyOpt,
string aliasQualifierOpt,
DiagnosticBag diagnostics)
{
string name;
ImmutableArray<MethodSymbol> explicitInterfaceImplementations;
GetNameAndExplicitInterfaceImplementations(
explicitlyImplementedPropertyOpt,
propertyName,
property.IsCompilationOutputWinMdObj(),
aliasQualifierOpt,
isGetMethod: true,
name: out name,
explicitInterfaceImplementations:
out explicitInterfaceImplementations);
return new SourcePropertyAccessorSymbol(
containingType,
name,
property,
propertyModifiers,
explicitInterfaceImplementations,
syntax.Expression.GetLocation(),
syntax,
diagnostics);
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:32,代码来源:SourcePropertyAccessorSymbol.cs
示例2: IsInExpressionBody
internal static bool IsInExpressionBody(
int position,
ArrowExpressionClauseSyntax expressionBodyOpt,
SyntaxToken semicolonToken)
{
return expressionBodyOpt != null
&& IsBeforeToken(position, expressionBodyOpt, semicolonToken);
}
开发者ID:tvsonar,项目名称:roslyn,代码行数:8,代码来源:LookupPosition.cs
示例3: CreateSpeculative
/// <summary>
/// Creates a speculative SemanticModel for an expression body that did not appear in the original source code.
/// </summary>
internal static MethodBodySemanticModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, ArrowExpressionClauseSyntax syntax, Binder rootBinder, int position)
{
Debug.Assert(parentSemanticModel != null);
Debug.Assert(syntax != null);
Debug.Assert(rootBinder != null);
Debug.Assert(rootBinder.IsSemanticModelBinder);
return new MethodBodySemanticModel(parentSemanticModel.Compilation, owner, rootBinder, syntax, parentSemanticModel, position);
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:12,代码来源:MethodBodySemanticModel.cs
示例4: VisitArrowExpressionClause
public override void VisitArrowExpressionClause(ArrowExpressionClauseSyntax node)
{
if (!this.InsideFluentOrInitializerExample) return;
var syntaxNode = node?.ChildNodes()?.LastOrDefault()?.WithAdditionalAnnotations();
if (syntaxNode == null) return;
var line = node.SyntaxTree.GetLineSpan(node.Span).StartLinePosition.Line;
var walker = new CodeWithDocumentationWalker(ClassDepth, line);
walker.Visit(syntaxNode);
this.Blocks.AddRange(walker.Blocks);
}
开发者ID:srikanthdasari,项目名称:elasticsearch-net,代码行数:10,代码来源:DocumentationFileWalker.cs
示例5: PropertyDeclaration
public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax accessorList, ArrowExpressionClauseSyntax expressionBody, EqualsValueClauseSyntax initializer, SyntaxToken semicolonToken)
{
return PropertyDeclaration(
attributeLists,
modifiers,
refKeyword: default(SyntaxToken),
type: type,
explicitInterfaceSpecifier: explicitInterfaceSpecifier,
identifier: identifier,
accessorList: accessorList,
expressionBody: expressionBody,
initializer: initializer,
semicolonToken: semicolonToken);
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:14,代码来源:PropertyDeclarationSyntax.cs
示例6: DestructorDeclaration
public static DestructorDeclarationSyntax DestructorDeclaration(
SyntaxList<AttributeListSyntax> attributeLists,
SyntaxTokenList modifiers,
SyntaxToken identifier,
ParameterListSyntax parameterList,
ArrowExpressionClauseSyntax expressionBody)
=> DestructorDeclaration(
attributeLists,
modifiers,
SyntaxFactory.Token(SyntaxKind.TildeToken),
identifier,
parameterList,
default(BlockSyntax),
expressionBody,
default(SyntaxToken));
开发者ID:XieShuquan,项目名称:roslyn,代码行数:15,代码来源:DestructorDeclarationSyntax.cs
示例7: ConstructorDeclaration
public static ConstructorDeclarationSyntax ConstructorDeclaration(
SyntaxList<AttributeListSyntax> attributeLists,
SyntaxTokenList modifiers,
SyntaxToken identifier,
ParameterListSyntax parameterList,
ConstructorInitializerSyntax initializer,
ArrowExpressionClauseSyntax expressionBody)
=> ConstructorDeclaration(
attributeLists,
modifiers,
identifier,
parameterList,
initializer,
default(BlockSyntax),
expressionBody,
default(SyntaxToken));
开发者ID:XieShuquan,项目名称:roslyn,代码行数:16,代码来源:ConstructorDeclarationSyntax.cs
示例8: MethodDeclaration
public static MethodDeclarationSyntax MethodDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken)
{
return SyntaxFactory.MethodDeclaration(
attributeLists,
modifiers,
default(SyntaxToken),
returnType,
explicitInterfaceSpecifier,
identifier,
typeParameterList,
parameterList,
constraintClauses,
body,
expressionBody,
semicolonToken);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:16,代码来源:MethodDeclarationSyntax.cs
示例9: IndexerDeclaration
public static IndexerDeclarationSyntax IndexerDeclaration(
SyntaxList<AttributeListSyntax> attributeLists,
SyntaxTokenList modifiers,
TypeSyntax type,
ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier,
SyntaxToken thisKeyword,
BracketedParameterListSyntax parameterList,
AccessorListSyntax accessorList,
ArrowExpressionClauseSyntax expressionBody,
SyntaxToken semicolonToken)
{
return SyntaxFactory.IndexerDeclaration(
attributeLists: attributeLists,
modifiers: modifiers,
refKeyword: default(SyntaxToken),
type: type,
explicitInterfaceSpecifier: explicitInterfaceSpecifier,
thisKeyword: thisKeyword,
parameterList: parameterList,
accessorList: accessorList,
expressionBody: expressionBody,
semicolonToken: semicolonToken);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:23,代码来源:IndexerDeclarationSyntax.cs
示例10: VisitArrowExpressionClause
/// <summary>
/// Called when the visitor visits a ArrowExpressionClauseSyntax node.
/// </summary>
public override void VisitArrowExpressionClause(ArrowExpressionClauseSyntax node)
{
var accessor = SyntaxFactory.ReturnStatement(node.Expression);
_members.Add(accessor);
}
开发者ID:jjrdk,项目名称:ArchiMetrics,代码行数:9,代码来源:MemberCollector.cs
示例11: SourcePropertyAccessorSymbol
private SourcePropertyAccessorSymbol(
NamedTypeSymbol containingType,
string name,
SourcePropertySymbol property,
DeclarationModifiers propertyModifiers,
ImmutableArray<MethodSymbol> explicitInterfaceImplementations,
Location location,
ArrowExpressionClauseSyntax syntax,
DiagnosticBag diagnostics) :
base(containingType, syntax.GetReference(), syntax.GetReference(), location)
{
_property = property;
_explicitInterfaceImplementations = explicitInterfaceImplementations;
_name = name;
_isAutoPropertyAccessor = false;
// The modifiers for the accessor are the same as the modifiers for the property,
// minus the indexer bit
var declarationModifiers = propertyModifiers & ~DeclarationModifiers.Indexer;
// ReturnsVoid property is overridden in this class so
// returnsVoid argument to MakeFlags is ignored.
this.MakeFlags(MethodKind.PropertyGet, declarationModifiers, returnsVoid: false, isExtensionMethod: false,
isMetadataVirtualIgnoringModifiers: explicitInterfaceImplementations.Any());
CheckModifiersForBody(location, diagnostics);
var info = ModifierUtils.CheckAccessibility(this.DeclarationModifiers);
if (info != null)
{
diagnostics.Add(info, location);
}
this.CheckModifiers(location, isAutoPropertyOrExpressionBodied: true, diagnostics: diagnostics);
if (this.IsOverride)
{
MethodSymbol overriddenMethod = this.OverriddenMethod;
if ((object)overriddenMethod != null)
{
// If this accessor is overriding a method from metadata, it is possible that
// the name of the overridden method doesn't follow the C# get_X/set_X pattern.
// We should copy the name so that the runtime will recognize this as an override.
_name = overriddenMethod.Name;
}
}
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:47,代码来源:SourcePropertyAccessorSymbol.cs
示例12: VisitArrowExpressionClause
public override void VisitArrowExpressionClause(ArrowExpressionClauseSyntax node)
{
var arrowBinder = new ExpressionVariableBinder(node, _enclosing);
AddToMap(node, arrowBinder);
Visit(node.Expression, arrowBinder);
}
开发者ID:XieShuquan,项目名称:roslyn,代码行数:6,代码来源:LocalBinderFactory.cs
示例13: GetDeclaredSymbol
public override IMethodSymbol GetDeclaredSymbol(ArrowExpressionClauseSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
{
// Can't define another member inside member.
return null;
}
开发者ID:orthoxerox,项目名称:roslyn,代码行数:5,代码来源:MemberSemanticModel.cs
示例14: TryGetEffectiveGetterBody
public static SyntaxNode TryGetEffectiveGetterBody(ArrowExpressionClauseSyntax propertyBody, AccessorListSyntax accessorList)
{
if (propertyBody != null)
{
return propertyBody.Expression;
}
return accessorList?.Accessors.Where(a => a.IsKind(SyntaxKind.GetAccessorDeclaration)).FirstOrDefault()?.Body;
}
开发者ID:XieShuquan,项目名称:roslyn,代码行数:9,代码来源:SyntaxUtilities.cs
示例15: TryGetSpeculativeSemanticModelCore
internal override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, ArrowExpressionClauseSyntax expressionBody, out SemanticModel speculativeModel)
{
position = CheckAndAdjustPosition(position);
var model = this.GetMemberModel(position);
if (model != null)
{
return model.TryGetSpeculativeSemanticModelCore(parentModel, position, expressionBody, out speculativeModel);
}
speculativeModel = null;
return false;
}
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:13,代码来源:SyntaxTreeSemanticModel.cs
示例16: BindExpressionBodyAsBlock
/// <summary>
/// Binds an expression-bodied member with expression e as either { return e;} or { e; }.
/// </summary>
public BoundBlock BindExpressionBodyAsBlock(ArrowExpressionClauseSyntax expressionBody,
DiagnosticBag diagnostics)
{
BoundExpression expression = this.BindValue(expressionBody.Expression, diagnostics, BindValueKind.RValue);
return CreateBlockFromExpression(expressionBody, this.Locals, expressionBody.Expression, expression, diagnostics);
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:9,代码来源:Binder_Statements.cs
示例17: TryGetSpeculativeSemanticModelCore
internal override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, ArrowExpressionClauseSyntax expressionBody, out SemanticModel speculativeModel)
{
speculativeModel = null;
return false;
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:5,代码来源:InitializerSemanticModel.cs
示例18: Update
public PropertyDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax accessorList, ArrowExpressionClauseSyntax expressionBody, EqualsValueClauseSyntax initializer, SyntaxToken semicolonToken)
{
return Update(attributeLists, modifiers, this.RefKeyword, type, explicitInterfaceSpecifier, identifier, accessorList, expressionBody, initializer, semicolonToken);
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:4,代码来源:PropertyDeclarationSyntax.cs
示例19: TryGetSpeculativeSemanticModelCore
internal override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, ArrowExpressionClauseSyntax expressionBody, out SemanticModel speculativeModel)
{
position = CheckAndAdjustPosition(position);
var binder = this.GetEnclosingBinder(position);
if (binder == null)
{
speculativeModel = null;
return false;
}
var methodSymbol = (MethodSymbol)this.MemberSymbol;
binder = new ExecutableCodeBinder(expressionBody, methodSymbol, binder);
speculativeModel = CreateSpeculative(parentModel, methodSymbol, expressionBody, binder, position);
return true;
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:17,代码来源:MethodBodySemanticModel.cs
示例20: Update
public MethodDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken)
{
return Update(attributeLists, modifiers, this.RefKeyword, returnType, explicitInterfaceSpecifier, identifier, typeParameterList, parameterList, constraintClauses, body, expressionBody, semicolonToken);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:4,代码来源:MethodDeclarationSyntax.cs
注:本文中的Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论