GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GenerallyPositive.Launcher Class Reference
Inheritance diagram for GenerallyPositive.Launcher:
GenerallyPositive.IAllowExecutableSetup GenerallyPositive.IAllowRunningExecutable GenerallyPositive.IAllowWaitingExecutable GenerallyPositive.IAllowToGPALObject< TResult > GenerallyPositive.IAllowToGPALObject< TResult > GenerallyPositive.IAllowWaitingExecutable

Public Member Functions

IAllowExecutableSetup WithExecutable (string executable)
IAllowExecutableSetup WithName (string name)
IAllowExecutableSetup WithArgument (string argument)
IAllowExecutableSetup WithWorkingDirectory (string directory)
 The directory the process starts in.
Said before Launch, because the working directory is part of how a process is started and cannot be changed once it is running.
IAllowExecutableSetup WithEnvironmentVariable (string name, string value)
 One environment variable the process starts with. Called once per variable.
The process inherits this one's environment, so this adds to what is already there rather than replacing it.
IAllowExecutableSetup WithOutputTo (Action< string > outputHandler)
 Where each line the process writes to standard output goes.
Said before Launch: reading a process's output is decided as it starts, so a handler given afterwards would never see a line.
IAllowExecutableSetup WithErrorTo (Action< string > errorHandler)
 Where each line the process writes to standard error goes. Said before Launch, for the same reason as WithOutputTo.
IAllowRunningExecutable Launch ()
bool IsRunning ()
 Whether the process is still running.
False before Launch, and false once it has ended, so a workflow can ask without minding which.
IAllowWaitingExecutable WaitForExit (int milliseconds)
 Wait up to this many milliseconds for the process to end.
void Kill ()
 Stop the process. What it started keeps running; KillTree is for those.
void KillTree ()
 Stop the process and everything it started, children first so nothing is orphaned.
Launcher ToGPALObject ()

Properties

string Name [get, set]
string Executable [get, set]

Detailed Description

Definition at line 29 of file Launcher.cs.

Constructor & Destructor Documentation

◆ Launcher()

GenerallyPositive.Launcher.Launcher ( )

Definition at line 42 of file Launcher.cs.

Member Function Documentation

◆ IsRunning()

bool GenerallyPositive.Launcher.IsRunning ( )

Whether the process is still running.
False before Launch, and false once it has ended, so a workflow can ask without minding which.

Returns
True while the process is up

Implements GenerallyPositive.IAllowRunningExecutable.

Definition at line 256 of file Launcher.cs.

◆ Kill()

void GenerallyPositive.Launcher.Kill ( )

Stop the process. What it started keeps running; KillTree is for those.

Implements GenerallyPositive.IAllowWaitingExecutable.

Definition at line 282 of file Launcher.cs.

◆ KillTree()

void GenerallyPositive.Launcher.KillTree ( )

Stop the process and everything it started, children first so nothing is orphaned.

Implements GenerallyPositive.IAllowWaitingExecutable.

Definition at line 294 of file Launcher.cs.

◆ Launch()

IAllowRunningExecutable GenerallyPositive.Launcher.Launch ( )

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 175 of file Launcher.cs.

◆ ToGPALObject()

Launcher GenerallyPositive.Launcher.ToGPALObject ( )

Implements GenerallyPositive.IAllowToGPALObject< TResult >.

Definition at line 331 of file Launcher.cs.

◆ WaitForExit()

IAllowWaitingExecutable GenerallyPositive.Launcher.WaitForExit ( int milliseconds)

Wait up to this many milliseconds for the process to end.

Parameters
millisecondsHow long to wait
Returns
Fluent interface to stop the process if it is still up

Implements GenerallyPositive.IAllowRunningExecutable.

Definition at line 268 of file Launcher.cs.

◆ WithArgument()

IAllowExecutableSetup GenerallyPositive.Launcher.WithArgument ( string argument)

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 57 of file Launcher.cs.

◆ WithEnvironmentVariable()

IAllowExecutableSetup GenerallyPositive.Launcher.WithEnvironmentVariable ( string name,
string value )

One environment variable the process starts with. Called once per variable.
The process inherits this one's environment, so this adds to what is already there rather than replacing it.

Parameters
nameThe variable's name
valueWhat it is set to
Returns
Fluent interface to define more settings

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 100 of file Launcher.cs.

◆ WithErrorTo()

IAllowExecutableSetup GenerallyPositive.Launcher.WithErrorTo ( Action< string > errorHandler)

Where each line the process writes to standard error goes. Said before Launch, for the same reason as WithOutputTo.

Parameters
errorHandlerCalled once per line
Returns
Fluent interface to define more settings

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 131 of file Launcher.cs.

◆ WithExecutable()

IAllowExecutableSetup GenerallyPositive.Launcher.WithExecutable ( string executable)

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 46 of file Launcher.cs.

◆ WithName()

IAllowExecutableSetup GenerallyPositive.Launcher.WithName ( string name)

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 52 of file Launcher.cs.

◆ WithOutputTo()

IAllowExecutableSetup GenerallyPositive.Launcher.WithOutputTo ( Action< string > outputHandler)

Where each line the process writes to standard output goes.
Said before Launch: reading a process's output is decided as it starts, so a handler given afterwards would never see a line.

Parameters
outputHandlerCalled once per line
Returns
Fluent interface to define more settings

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 119 of file Launcher.cs.

◆ WithWorkingDirectory()

IAllowExecutableSetup GenerallyPositive.Launcher.WithWorkingDirectory ( string directory)

The directory the process starts in.
Said before Launch, because the working directory is part of how a process is started and cannot be changed once it is running.

Parameters
directoryThe directory to start in
Returns
Fluent interface to define more settings

Implements GenerallyPositive.IAllowExecutableSetup.

Definition at line 80 of file Launcher.cs.

Property Documentation

◆ Executable

string GenerallyPositive.Launcher.Executable
getset

Definition at line 32 of file Launcher.cs.

◆ Name

string GenerallyPositive.Launcher.Name
getset

Definition at line 31 of file Launcher.cs.


The documentation for this class was generated from the following file: