Class CallStack
Displays list of call stack frames during script debugging.
[ToolboxBitmap(typeof(CallStack), "Images.CallStack.Icon.bmp")]
public class CallStack : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
- Inheritance
-
CallStack
- Implements
Examples
Here is how to declare a CallStack and handle its events from the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var callStackControl = new Alternet.Scripter.Debugger.UI.CallStack();
callStackControl.Dock = System.Windows.Forms.DockStyle.Fill;
callStackControl.Debugger = debugger;
callStackControl.CallStackClick += CallStackControl_CallStackClick;
}
private void CallStackControl_CallStackClick(object sender, Alternet.Scripter.Debugger.UI.CallStackClickEventArgs e)
{
if (e.StackFrame != null)
{
System.Windows.Forms.MessageBox.Show(e.StackFrame.Name);
}
}
}
Here is how to declare a CallStack and handle its events from the Visual Basic code:
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim callStackControl = New Alternet.Scripter.Debugger.UI.CallStack()
callStackControl.Dock = System.Windows.Forms.DockStyle.Fill
callStackControl.Debugger = debugger
AddHandler callStackControl.CallStackClick, AddressOf CallStackControl_CallStackClick
End Sub
Private Sub CallStackControl_CallStackClick(ByVal sender As Object, ByVal e As Alternet.Scripter.Debugger.UI.CallStackClickEventArgs)
If e.StackFrame IsNot Nothing Then
System.Windows.Forms.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 application. 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
Properties
- Debugger
Gets or sets
IScriptDebuggerBase
which stack frames displayed by this user control.
- SelectedFrame
Gets a currently selected stack frame.
Methods
- Dispose(bool)
Clean up any resources being used.
- Localize()
Localizes string resources.
- SetFrames(StackFrame[])
Sets a list of call stack frames to be displayed.
- TrySwitchToTopUserStackFrame()
Switches debugging to the given stack frame.
Events
- CallStackClick
When implemented by a class, occurs when a user clicks on a call stack frame in the list.
- FramesChanged
When implemented by a class, occurs when current stack frame changes.