public override HashSet <ISymbol> GetAnalyzableSymbols(SymbolAnalysisContext context, INamedTypeSymbol containingType)
        {
            HashSet <ISymbol> properties = null;

            ImmutableArray <ISymbol> members = containingType.GetMembers();

            for (int i = 0; i < members.Length; i++)
            {
                if (members[i].Kind == SymbolKind.Property)
                {
                    var propertySymbol = (IPropertySymbol)members[i];

                    if (!propertySymbol.IsIndexer &&
                        !propertySymbol.IsReadOnly &&
                        !propertySymbol.IsImplicitlyDeclared &&
                        MakeMemberReadOnlyHelpers.ValidateType(propertySymbol.Type) &&
                        propertySymbol.ExplicitInterfaceImplementations.IsDefaultOrEmpty &&
                        !propertySymbol.HasAttribute(MetadataNames.System_Runtime_Serialization_DataMemberAttribute))
                    {
                        IMethodSymbol setMethod = propertySymbol.SetMethod;

                        if (setMethod?.DeclaredAccessibility == Accessibility.Private &&
                            setMethod.GetAttributes().IsEmpty &&
                            setMethod.GetSyntaxOrDefault(context.CancellationToken) is AccessorDeclarationSyntax accessor &&
                            accessor.BodyOrExpressionBody() == null)
                        {
                            (properties ?? (properties = new HashSet <ISymbol>())).Add(propertySymbol);
                        }
                    }
                }
            }

            return(properties);
        }
        public override HashSet <ISymbol> GetAnalyzableSymbols(SymbolAnalysisContext context, INamedTypeSymbol containingType)
        {
            HashSet <ISymbol> analyzableFields = null;

            foreach (ISymbol member in containingType.GetMembers())
            {
                if (member.Kind == SymbolKind.Field)
                {
                    var fieldSymbol = (IFieldSymbol)member;

                    if (!fieldSymbol.IsConst &&
                        fieldSymbol.DeclaredAccessibility == Accessibility.Private &&
                        !fieldSymbol.IsReadOnly &&
                        !fieldSymbol.IsVolatile &&
                        !fieldSymbol.IsImplicitlyDeclared &&
                        MakeMemberReadOnlyHelpers.ValidateType(fieldSymbol.Type))
                    {
                        (analyzableFields ?? (analyzableFields = new HashSet <ISymbol>())).Add(fieldSymbol);
                    }
                }
            }

            return(analyzableFields);
        }