Docs · API reference · Verso.Kernels

ScriptGlobals Class#

Host object provided to Roslyn C# scripts, exposing the shared IVariableStore as a top-level Variables identifier so that C# cells can read data stored by other kernels (e.g. SQL results).

public sealed class ScriptGlobals

Inheritance System.Object → ScriptGlobals

Properties#

Variables Property#

The shared variable store for this notebook session.

public Verso.Abstractions.IVariableStore Variables { get; }

Property Value#

IVariableStore

Methods#

GetInputAsync(string) Method#

Asks the user for a line of text and waits for the answer.

public System.Threading.Tasks.Task<string?> GetInputAsync(string prompt="");

Parameters#

prompt System.String

Text shown beside the input box.

Returns#

System.Threading.Tasks.Task<System.String>
The entered text, or null when the user cancels.

Exceptions#

System.NotSupportedException
The host has no interactive input, e.g. a headless run.

GetPasswordAsync(string) Method#

Asks the user for a line of text with the typed characters masked.

public System.Threading.Tasks.Task<string?> GetPasswordAsync(string prompt="");

Parameters#

prompt System.String

Text shown beside the input box.

Returns#

System.Threading.Tasks.Task<System.String>
The entered text, or null when the user cancels.

Exceptions#

System.NotSupportedException
The host has no interactive input, e.g. a headless run.