Skip to content

Components

Zev Spitz edited this page Jun 10, 2020 · 1 revision

Components of Periscope

This is an overview of Periscope's components.

Base types

The types described here are generally abstract types, with methods that need to be overridden for a given visualizer. This project has a simple demo visualizer which shows what needs to be overridden; screenshots come from that visualizer.

ConfigBase

This is the base type for the config object, which determines the current window's state, and which is passed to the debuggee side to get the needed data about the visualized expression.

VisualizerBase

The base type for the visualizer. This opens a new window which inherits from VisualizerWindowBase, and passes the initial config to the window.

VisualizerWindowBase

The base class for the visualizer window. This adds the following UI elements to the window chrome:

VisualizerWindowBase chrome

  1. Expression textbox shows the current expression being visualized. Note that the visualizer API doesn't expose the actual expression (see here and here), so when the visualizer needs the expression and it's empty, the user will be prompted:

    Prompt for debugged expression

    But the value can also be set directly in the textbox.

  2. Settings link shows a popup which can contain a view and view-model for the config object, specific to the visualizer.

    Settings

    When clicking out of the popup, the visualizer window will check if the config has been changed. If it has, the window will re-request data for the visualized expression, based on the new config.

    Settings - usage

Commands

These commands can be added to your view-model and triggered via binding.

CopyWatchExpression command

This command takes a format string into which the initial visualized expression is plugged in. The resulting format string is then copied to the clipboard.

CopyWatchExpression command

Ideally, the command would actually add the watch, instead of just copying the necessary expression to the clipboard; tracked under #2.

OpenInNewWindow command

This command allows your view-model to request a new window be opened, with a possibly modified config.

OpenInNewWindow command

Clone this wiki locally