コード例 #1
0
		public override void PostWalkCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) { 
			MethodsCalled["PostWalkCodeUsingDeclaration"]=true;
		}
コード例 #2
0
        void ProcessCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) {

            if (codeUsingDeclarationSyntax?.Namespace == null) {
                return;
            }

            var nsSyntax = codeUsingDeclarationSyntax.Namespace;
            var ns       = nsSyntax.ToString();

            if (_codeUsings.Contains(ns)) {
                _diagnostics.Add(new Diagnostic(
                    codeUsingDeclarationSyntax.GetLocation(),
                    DiagnosticDescriptors.DeadCode.Nav1002UsingDirective0AppearedPreviously,
                    ns));

            } else {
                _codeUsings.Add(ns);
            }
        }
コード例 #3
0
		// CodeUsingDeclarationSyntax
		public override bool WalkCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) { 
			MethodsCalled["WalkCodeUsingDeclaration"]=true;
			return true; 
		}