コード例 #1
0
        private static void AnalyzeCore(SyntaxNodeAnalysisContext context, SyntaxToken identifier, string type)
        {
            var name = identifier.Text;

            if (name == null || Utils.NameIsGood(name, 0, false))
            {
                return;
            }
            context.ReportDiagnostic(NameAnalyzer.CreateDiagnostic(Rule, identifier, NameType.CamelCased, type));
        }
コード例 #2
0
        private static void Analyze(SyntaxNodeAnalysisContext context)
        {
            var node       = (TypeParameterSyntax)context.Node;
            var identifier = node.Identifier;
            var name       = identifier.Text;

            if (name == null || (name.StartsWith("T") && Utils.NameIsGood(name, 1, true)))
            {
                return;
            }
            context.ReportDiagnostic(NameAnalyzer.CreateDiagnostic(Rule, identifier, NameType.TPascalCased));
        }