Пример #1
0
        private void Analyzer(SyntaxNodeAnalysisContext context)
        {
            var method = new MethodInformation(
                "Parse",
                "System.Net.IPAddress.Parse(string)",
                args =>
            {
                parseMethodInfo.Value.Invoke(null, new[] { args[0].ToString() });
            }
                );
            var checker = new MethodChecker(context, Rule);

            checker.AnalyzeMethod(method);
        }
Пример #2
0
        private static void Analyzer(SyntaxNodeAnalysisContext context)
        {
            if (context.IsGenerated())
            {
                return;
            }
            var method = new MethodInformation(
                "Parse",
                "System.Net.IPAddress.Parse(string)",
                args =>
            {
                if (!(args[0] is string))
                {
                    return;
                }
                parseMethodInfo.Value.Invoke(null, new[] { args[0].ToString() });
            }
                );
            var checker = new MethodChecker(context, Rule);

            checker.AnalyzeMethod(method);
        }