public QualifiedField(QualifiedType containingType, string name) : base(containingType, name) { }
internal static bool IsSameType(this ExpressionSyntax expression, QualifiedType metadataName, SemanticModel semanticModel, CancellationToken cancellationToken) { var type = semanticModel?.Compilation.GetTypeByMetadataName(metadataName.FullName); return(expression.IsSameType(type, semanticModel, cancellationToken)); }
internal static bool IsSameType(this ExpressionSyntax expression, QualifiedType metadataName, SyntaxNodeAnalysisContext context) { return(expression.IsSameType(metadataName, context.SemanticModel, context.CancellationToken)); }
internal static IEnumerable <AttributeSyntax> FindAttributes(CompilationUnitSyntax assemblyInfo, QualifiedType expectedType, SemanticModel semanticModel, CancellationToken cancellationToken) { foreach (var attributeList in assemblyInfo.AttributeLists) { foreach (var candidate in attributeList.Attributes) { if (semanticModel.TryGetNamedType(candidate, expectedType, cancellationToken, out _)) { yield return(candidate); } } } }
private static bool TryGetCallback(ObjectCreationExpressionSyntax objectCreation, QualifiedType callbackType, SemanticModel semanticModel, CancellationToken cancellationToken, out ArgumentSyntax callback) { callback = null; return(TryGetConstructor(objectCreation, semanticModel, cancellationToken, out var constructor) && constructor.TryFindParameter(callbackType, out var parameter) && objectCreation.TryFindArgument(parameter, out callback)); }
internal static IEnumerable <AttributeSyntax> FindAttributes(CompilationUnitSyntax assemblyInfo, QualifiedType typeName, SemanticModel semanticModel, CancellationToken cancellationToken) { foreach (var attributeList in assemblyInfo.AttributeLists) { foreach (var candidate in attributeList.Attributes) { if (Attribute.IsType(candidate, typeName, semanticModel, cancellationToken)) { yield return(candidate); } } } }