Table of Contents

Class CallStack

Namespace
Alternet.Scripter.Debugger.UI.Wpf
Assembly
Alternet.Scripter.Debugger.UI.Wpf.v9.dll

Interaction logic for CallStack.xaml

public class CallStack : UserControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged
Inheritance
CallStack
Implements
Extension Methods

Examples

Here is how to declare a CallStack and handle its events from the C# code:

using System.Diagnostics;
using System.Windows;

using Alternet.Scripter.Debugger;
using Alternet.Scripter.Debugger.UI.Wpf;

public partial class MainWindow : Window
{
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var debugger = new ScriptDebugger();

        var callStackControl = new CallStack();
        callStackControl.Debugger = debugger;
        callStackControl.CallStackClick += CallStackControl_CallStackClick;
    }

    private void CallStackControl_CallStackClick(object sender, CallStackClickEventArgs e)
    {
        if (e.StackFrame != null)
        {
            MessageBox.Show(e.StackFrame.Name);
        }
    }
}

Here is how to declare a CallStack and handle its events from the Visual Basic code:


Imports Alternet.Scripter.Debugger
Imports Alternet.Scripter.Debugger.UI.Wpf

Partial Public Class MainWindow
    Inherits Window
    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim debugger = New ScriptDebugger()

        Dim callStackControl = New CallStack()
        callStackControl.Debugger = debugger
        AddHandler callStackControl.CallStackClick, AddressOf CallStackControl_CallStackClick
    End Sub

    Private Sub CallStackControl_CallStackClick(ByVal sender As Object, ByVal e As CallStackClickEventArgs)
        If e.StackFrame IsNot Nothing Then
            MessageBox.Show(e.StackFrame.Name)
        End If
    End Sub
End Class

Remarks

CallStack is a visual control used to display and navigate through the list of function calls currently on the stack during script debugging.

The call stack helps to examine and understand the execution flow of an app. Using the Call Stack control, you can view the function or procedure calls currently on the stack when script execution is stopped. The Call Stack shows the order in which methods and functions are called.

The most important properties of the CallStack are:

The Debugger property specifies ScriptDebugger instance, which stack frames are displayed by the CallStack control.

The SelectedFrame property represents the currently selected stack frame.

Constructors

CallStack()

Initializes a new instance of the CallStack class with default settings.

Fields

showCallStack

Properties

Debugger

Gets or sets IScriptDebugger which stack frames displayed by this user control.

SelectedFrame

Gets a currently selected stack frame.

Methods

Localize()
OnShowCallStackChanged()
RaisePropertyChanged(string)
SetFrames(StackFrame[])

Sets a list of call stack frames to be displayed.

TrySwitchToTopUserStackFrame()

Switches debugging to the given stack frame.

Events

CallStackClick

Occurs when given process receives variables.

PropertyChanged

Occurs when a property value changes.

StackFramesChanged

When implemented by a class, occurs when current stack frame changes.