private static void Handle(SyntaxNodeAnalysisContext context)
 {
     if (!context.IsExcludedFromAnalysis() &&
         context.ContainingSymbol is IPropertySymbol {
         IsStatic : false
     } property&&
         context.Node is PropertyDeclarationSyntax propertyDeclaration &&
         propertyDeclaration.Getter() is { } getter&&
         propertyDeclaration.Setter() is { } setter)
     {
         if (ClrProperty.Match(property, context.SemanticModel, context.CancellationToken) is { SetValue : { } setValue, BackingSet : { } backingSet, GetValue : { } getValue, BackingGet : { } backingGet })
Ejemplo n.º 2
0
 private static void HandleAssignment(SyntaxNodeAnalysisContext context)
 {
     if (!context.IsExcludedFromAnalysis() &&
         context.Node is AssignmentExpressionSyntax {
         Left : { } left
     } assignment&&
         !IsInObjectInitializer(assignment) &&
         !IsInConstructor(assignment) &&
         context.SemanticModel.TryGetSymbol(left, context.CancellationToken, out IPropertySymbol? property) &&
         !IsIgnored(property) &&
         ClrProperty.Match(property, context.SemanticModel, context.CancellationToken) is { BackingSet : { } backingSet } &&