/// <summary>
        ///
        /// </summary>
        /// <param name="mc"></param>
        private void UpdateMethodCall(MethodCall mc)
        {
            var args = mc.Arguments.ToList();
            var md   = mc.FindMatches().FirstOrDefault() as MethodDefinition;

            if (md != null && IsLocalMethod(md))
            {
                //local method
                InvokedLocalMethods.Add(md);
            }
            else
            {
                //external method
                InvokedExternalMethods.Add(md);
            }
            foreach (var arg in args)
            {
                UpdateByExpression(arg);
            }
        }
示例#2
0
        /// <summary>
        /// Find MethodDefinition matching from MethodCall
        /// </summary>
        /// <param name="mc"></param>
        /// <returns></returns>
        private MethodDefinition FindMatchedMd(MethodCall mc)
        {
            INamedEntity match = null;

            try {
                match = mc.FindMatches().FirstOrDefault();
            } catch (Exception e) {
                Console.WriteLine("{0}:{1}:{2}: Call Exception {3}", mc.Location.SourceFileName, mc.Location.StartingLineNumber, mc.Location.StartingColumnNumber, e);
            }
            if (null != match)
            {
                //Console.WriteLine("match : {0} ", match);
                if (match is MethodDefinition)
                {
                    //Console.WriteLine("method Definition");
                    MethodDefinition md = (MethodDefinition)match;
                    //Console.WriteLine("md full name :" + md.GetFullName());
                    return(md);
                }
            }
            return(null);
        }