Пример #1
0
        private static VariableTree GetVariables(DebuggerApi api, Variable variable, int level)
        {
            var children = variable.HasChildren && level <= MaxLevel?api.GetCurrentVariables(variable.Id) : new List <Variable>();

            return(new VariableTree
            {
                CurrentItem = variable,
                Children = children.Select(x => GetVariables(api, x, level + 1)).ToList()
            });
        }
Пример #2
0
        private static VariableTree GetVariables(DebuggerApi api, Scope scope)
        {
            var variables = api.GetCurrentVariables(scope.Id);

            return(new VariableTree
            {
                CurrentItem = new Variable(scope.Id, scope.Name, string.Empty, string.Empty, true),
                Children = variables.Select(x => GetVariables(api, x, 0)).ToList()
            });
        }