Exemple #1
0
        private void ShowVariableInsights(Token token, ToolTipRequestEventArgs args)
        {
            var stackFrames = _debuggerService.GetStackFrames();
            var stackFrame  = stackFrames?.FirstOrDefault();

            if (stackFrame == null)
            {
                return;
            }

            var variable =
                stackFrame?.LocalVariables.Children.FirstOrDefault(
                    x => x.Name.Equals(token.Text, StringComparison.InvariantCultureIgnoreCase));

            if (variable == null)
            {
                // Make sure to unset _currentToken since we can't find a variable named what we've selected.
                _currentToken = null;
                return;
            }

            // Create an inspectable object
            var inspectableObject = new Dictionary <string, object>
            {
                { variable.Name, variable.Value }
            };

            ShowInspectorWindow(inspectableObject);
        }