private void AnalyzeClassDeclaration(SyntaxNodeAnalysisContext context) { if (context.IsAutomaticallyGeneratedCode()) { return; } var declaration = Cast <ClassDeclarationSyntax>(context.Node); RegexManager.DoesNotSatisfyNonPrivateNameRule(context, declaration.Identifier.Text, declaration.Identifier.GetLocation(), Rule); }
private void AnalyzeMethodDeclaration(SyntaxNodeAnalysisContext context) { if (context.IsAutomaticallyGeneratedCode()) { return; } var declaration = Cast <MethodDeclarationSyntax>(context.Node); RegexManager.DoesNotSatisfyNonPrivateNameRule(context, declaration.Identifier.Text, declaration.Identifier.GetLocation(), Rule); foreach (var parameter in declaration.ParameterList.Parameters) { RegexManager.DoesNotSatisfyLocalVariableNameRule(context, parameter.Identifier.Text, parameter.Identifier.GetLocation(), Rule); } }
private void AnalyzePropertyDeclaration(SyntaxNodeAnalysisContext context) { if (context.IsAutomaticallyGeneratedCode()) { return; } var declaration = Cast <PropertyDeclarationSyntax>(context.Node); if (!IsExternallyVisible(declaration.Modifiers)) { return; } var propertiesString = declaration.Identifier.Text; RegexManager.DoesNotSatisfyNonPrivateNameRule(context, propertiesString, declaration.Identifier.GetLocation(), Rule); }
private void AnalyzeFieldDeclaration(SyntaxNodeAnalysisContext context) { if (context.IsAutomaticallyGeneratedCode()) { return; } var declaration = Cast <FieldDeclarationSyntax>(context.Node); if (!IsExternallyVisible(declaration.Modifiers)) { return; } var variableDeclarator = declaration.Declaration.Variables.FirstOrDefault()?.Identifier.Text; var location = declaration.Declaration.Variables.FirstOrDefault()?.Identifier.GetLocation(); RegexManager.DoesNotSatisfyNonPrivateNameRule(context, variableDeclarator, location, Rule); }