Example #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());
        }
Example #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);
        }
Example #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);
        }
Example #4
0
 public static IEnumerable <MethodDefinition> GetAllMethods(SourceFolder folder)
 {
     return(folder.Data.GlobalScope.GetDescendantScopesAndSelf <MethodDefinition>());
 }