Example #1
0
        public static List <GroupedTimer> GetParents(GroupedTimer timer, Dictionary <string, GroupedTimer> map, int count = 10)
        {
            if (timer == null)
            {
                return(new List <GroupedTimer>());
            }

            var result = new List <GroupedTimer>();
            var parent = timer;

            foreach (var i in Enumerable.Range(0, count))
            {
                parent = parent.Info.Parents.Take(1).Select(i => map.Get(i)).FirstOrDefault();
                if (parent == null)
                {
                    break;
                }
                result.Add(parent);
            }
            return(result);
        }
Example #2
0
        public static List <GroupedTimer> GetChildren(GroupedTimer timer, Dictionary <string, GroupedTimer> map, int count = 10)
        {
            if (timer == null)
            {
                return(new List <GroupedTimer>());
            }

            var result = new List <GroupedTimer>();
            var child  = timer;

            result.Add(child);
            foreach (var i in Enumerable.Range(0, count - 1))
            {
                child = child.Info.Children.Take(1).Select(i => map.Get(i)).FirstOrDefault();
                if (child == null)
                {
                    break;
                }
                result.Add(child);
            }
            return(result);
        }