示例#1
0
        public static int GetAllExpressions(SourceFolder folder)
        {
            var expressions = from file in folder.Archive.FileUnits
                              from expression in file.Descendants(SRC.Expression)
                              select expression;

            return(expressions.Count());
        }
示例#2
0
        public static IEnumerable <MethodCall> GetAllCalls(SourceFolder folder)
        {
            var allCalls = from scope in folder.Data.GlobalScope.GetDescendantScopesAndSelf()
                           from call in scope.MethodCalls
                           select call;

            return(allCalls);
        }
示例#3
0
        public static Dictionary <string, IList <MethodDefinition> > GetAllMethodsByName(SourceFolder folder)
        {
            var results       = new Dictionary <string, IList <MethodDefinition> >();
            var methodsByName = from method in GetAllMethods(folder)
                                group method by method.Name into g
                                select g;

            foreach (var group in methodsByName)
            {
                results[group.Key] = group.ToList <MethodDefinition>();
            }
            return(results);
        }
示例#4
0
 public static IEnumerable <MethodDefinition> GetAllMethods(SourceFolder folder)
 {
     return(folder.Data.GlobalScope.GetDescendantScopesAndSelf <MethodDefinition>());
 }