Skip to main content

Handover class

Namespace: Arlecchino.Hosting · Assembly: Arlecchino

Lends the terminal to a full-screen program of its own — an editor, a pager, a shell — and takes it back afterward. It runs on the drawing thread and blocks it, so no frame lands on top of the other program.

public sealed class Handover

Properties

MemberSummary
IsAwayWhether another program has the terminal at this moment.

Methods

MemberSummary
Give(Action)Hands the terminal over for the length of a call and takes it back however that call ends, error included. What is taken back is the terminal that was in force to begin with.
Run(ProcessStartInfo)Runs a program with the terminal to itself and waits for it to end. None of its three streams is redirected, so what it writes and what is typed into it go straight to the terminal.

Properties in detail

IsAway

public bool IsAway { get; }

Whether another program has the terminal at this moment.

Type bool

Methods in detail

Give(Action)

public void Give(Action work);

Hands the terminal over for the length of a call and takes it back however that call ends, error included. What is taken back is the terminal that was in force to begin with.

Parameters

NameTypeDescription
workActionWhat to do while the terminal belongs to the other program.

Exceptions

TypeThrown when
InvalidOperationExceptionCalled from off the drawing thread.

Run(ProcessStartInfo)

public int Run(ProcessStartInfo start);

Runs a program with the terminal to itself and waits for it to end. None of its three streams is redirected, so what it writes and what is typed into it go straight to the terminal.

Parameters

NameTypeDescription
startProcessStartInfoThe program and its arguments.

Returns int — What it exited with.

Exceptions

TypeThrown when
InvalidOperationExceptionNothing could be started from what was asked for.