Exemple #1
0
 public QualifiedField(QualifiedType containingType, string name)
     : base(containingType, name)
 {
 }
Exemple #2
0
        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));
        }
Exemple #3
0
 internal static bool IsSameType(this ExpressionSyntax expression, QualifiedType metadataName, SyntaxNodeAnalysisContext context)
 {
     return(expression.IsSameType(metadataName, context.SemanticModel, context.CancellationToken));
 }
Exemple #4
0
 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);
             }
         }
     }
 }
Exemple #5
0
 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));
 }
Exemple #6
0
 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);
             }
         }
     }
 }