本文整理汇总了C#中SyntaxNode.GetReference方法的典型用法代码示例。如果您正苦于以下问题:C# SyntaxNode.GetReference方法的具体用法?C# SyntaxNode.GetReference怎么用?C# SyntaxNode.GetReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyntaxNode
的用法示例。
在下文中一共展示了SyntaxNode.GetReference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FieldOrPropertyInitializer
public FieldOrPropertyInitializer(FieldSymbol fieldOpt, SyntaxNode syntax, int precedingInitializersLength)
{
Debug.Assert(syntax.IsKind(SyntaxKind.EqualsValueClause) && fieldOpt != null || syntax is StatementSyntax);
FieldOpt = fieldOpt;
Syntax = syntax.GetReference();
PrecedingInitializersLength = precedingInitializersLength;
}
示例2: Create
internal static GlobalExpressionVariable Create(
SourceMemberContainerTypeSymbol containingType,
DeclarationModifiers modifiers,
TypeSyntax typeSyntax,
string name,
SyntaxNode syntax,
Location location,
FieldSymbol containingFieldOpt,
SyntaxNode nodeToBind)
{
Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax);
var syntaxReference = syntax.GetReference();
return typeSyntax.IsVar
? new InferrableGlobalExpressionVariable(containingType, modifiers, typeSyntax, name, syntaxReference, location, containingFieldOpt, nodeToBind)
: new GlobalExpressionVariable(containingType, modifiers, typeSyntax, name, syntaxReference, location);
}
示例3: InferrableGlobalExpressionVariable
internal InferrableGlobalExpressionVariable(
SourceMemberContainerTypeSymbol containingType,
DeclarationModifiers modifiers,
TypeSyntax typeSyntax,
string name,
SyntaxReference syntax,
Location location,
FieldSymbol containingFieldOpt,
SyntaxNode nodeToBind)
: base(containingType, modifiers, typeSyntax, name, syntax, location)
{
Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax);
_containingFieldOpt = containingFieldOpt;
_nodeToBind = nodeToBind.GetReference();
}