本文整理汇总了C#中ISymbol.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# ISymbol.Accept方法的具体用法?C# ISymbol.Accept怎么用?C# ISymbol.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISymbol
的用法示例。
在下文中一共展示了ISymbol.Accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public virtual void Visit(ISymbol symbol)
{
if (symbol != null)
{
symbol.Accept(this);
}
}
示例2: GetSpecId
public static string GetSpecId(
ISymbol symbol,
IReadOnlyList<string> typeGenericParameters,
IReadOnlyList<string> methodGenericParameters = null)
{
var id = symbol.Accept(SpecIdCoreVisitor.Instance);
if (methodGenericParameters == null)
{
id = SpecMethodGenericParameter(symbol as IMethodSymbol ?? symbol.ContainingSymbol as IMethodSymbol, id);
}
else
{
id = SpecMethodGenericParameter(methodGenericParameters, id);
}
id = SpecTypeGenericParameter(typeGenericParameters, id);
return id;
}
示例3: GenerateReference
protected override void GenerateReference(ISymbol symbol, ReferenceItem reference, SymbolVisitorAdapter adapter, bool asOverload)
{
symbol.Accept(new CSReferenceItemVisitor(reference, asOverload));
}
示例4: ToDisplayParts
private static ImmutableArray<SymbolDisplayPart> ToDisplayParts(
ISymbol symbol,
SemanticModel semanticModelOpt,
int positionOpt,
SymbolDisplayFormat format,
bool minimal)
{
if (symbol == null)
{
throw new ArgumentNullException(nameof(symbol));
}
if (minimal)
{
if (semanticModelOpt == null)
{
throw new ArgumentException(CSharpResources.SyntaxTreeSemanticModelMust);
}
else if (positionOpt < 0 || positionOpt > semanticModelOpt.SyntaxTree.Length) // Note: not >= since EOF is allowed.
{
throw new ArgumentOutOfRangeException(CSharpResources.PositionNotWithinTree);
}
}
else
{
Debug.Assert(semanticModelOpt == null);
Debug.Assert(positionOpt < 0);
}
var builder = ArrayBuilder<SymbolDisplayPart>.GetInstance();
var visitor = new SymbolDisplayVisitor(builder, format, semanticModelOpt, positionOpt);
symbol.Accept(visitor);
return builder.ToImmutableAndFree();
}
示例5: GenerateReference
protected override void GenerateReference(ISymbol symbol, ReferenceItem reference, SymbolVisitorAdapter adapter)
{
symbol.Accept(new VBReferenceItemVisitor(reference));
}
示例6: GetName
public string GetName(ISymbol symbol)
{
var visitor = Create();
symbol.Accept(visitor);
return visitor.GetTypeName();
}