C# Class JustAProgrammer.ADPR.ADPRUserInterface

An implementation of the PSHostUserInterface abstract class for console applications.
Based on the msdn page Writing a Windows PowerShell Host Application
Inheritance: System.Management.Automation.Host.PSHostUserInterface
显示文件 Open project: zippy1981/AppDomainPoshRunner

Public Methods

Method Description
Prompt ( string caption, string message, Collection descriptions ) : PSObject>.Dictionary

Prompts the user for input. In this example this functionality is not needed so the method throws a NotImplementException exception.

PromptForChoice ( string caption, string message, Collection choices, int defaultChoice ) : int

Provides a set of choices that enable the user to choose a single option from a set of options. In this example this functionality is not needed so the method throws a NotImplementException exception.

PromptForCredential ( string caption, string message, string userName, string targetName ) : System.Management.Automation.PSCredential

Prompts the user for credentials with a specified prompt window caption, prompt message, user name, and target name. In this example this functionality is not needed so the method throws a NotImplementException exception.

PromptForCredential ( string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options ) : System.Management.Automation.PSCredential

Prompts the user for credentials by using a specified prompt window caption, prompt message, user name and target name, credential types allowed to be returned, and UI behavior options. In this example this functionality is not needed so the method throws a NotImplementException exception.

ReadLine ( ) : string

Reads characters that are entered by the user until a newline (carriage return) is encountered.

ReadLineAsSecureString ( ) : System.Security.SecureString

Reads characters entered by the user until a newline (carriage return) is encountered and returns the characters as a secure string. In this example this functionality is not needed so the method throws a NotImplementException exception.

Write ( ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value ) : void

Writes characters to the output display of the host and specifies the foreground and background colors of the characters.

Write ( string value ) : void

Writes characters to the output display of the host.

WriteDebugLine ( string message ) : void

Writes a debug message to the output display of the host.

WriteErrorLine ( string message ) : void

Writes an error message to the output display of the host.

WriteLine ( ) : void

Writes a newline character (carriage return) to the output display of the host.

WriteLine ( ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value ) : void

Writes a line of characters to the output display of the host with foreground and background colors and appends a newline (carriage return).

WriteLine ( string value ) : void

Writes a line of characters to the output display of the host and appends a newline character(carriage return).

WriteProgress ( long sourceId, System.Management.Automation.ProgressRecord record ) : void

Writes a progress report to the output display of the host.

WriteVerboseLine ( string message ) : void

Writes a verbose message to the output display of the host.

WriteWarningLine ( string message ) : void

Writes a warning message to the output display of the host.

Method Details

Prompt() public method

Prompts the user for input. In this example this functionality is not needed so the method throws a NotImplementException exception.
public Prompt ( string caption, string message, Collection descriptions ) : PSObject>.Dictionary
caption string The caption or title of the prompt.
message string The text of the prompt.
descriptions Collection A collection of FieldDescription objects that /// describe each field of the prompt.
return PSObject>.Dictionary

PromptForChoice() public method

Provides a set of choices that enable the user to choose a single option from a set of options. In this example this functionality is not needed so the method throws a NotImplementException exception.
public PromptForChoice ( string caption, string message, Collection choices, int defaultChoice ) : int
caption string Text that proceeds (a title) the choices.
message string A message that describes the choice.
choices Collection A collection of ChoiceDescription objects that describes /// each choice.
defaultChoice int The index of the label in the Choices parameter /// collection. To indicate no default choice, set to -1.
return int

PromptForCredential() public method

Prompts the user for credentials with a specified prompt window caption, prompt message, user name, and target name. In this example this functionality is not needed so the method throws a NotImplementException exception.
public PromptForCredential ( string caption, string message, string userName, string targetName ) : System.Management.Automation.PSCredential
caption string The caption for the message window.
message string The text of the message.
userName string The user name whose credential is to be prompted for.
targetName string The name of the target for which the credential is collected.
return System.Management.Automation.PSCredential

PromptForCredential() public method

Prompts the user for credentials by using a specified prompt window caption, prompt message, user name and target name, credential types allowed to be returned, and UI behavior options. In this example this functionality is not needed so the method throws a NotImplementException exception.
public PromptForCredential ( string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options ) : System.Management.Automation.PSCredential
caption string The caption for the message window.
message string The text of the message.
userName string The user name whose credential is to be prompted for.
targetName string The name of the target for which the credential is collected.
allowedCredentialTypes PSCredentialTypes A PSCredentialTypes constant that /// identifies the type of credentials that can be returned.
options PSCredentialUIOptions A PSCredentialUIOptions constant that identifies the UI /// behavior when it gathers the credentials.
return System.Management.Automation.PSCredential

ReadLine() public method

Reads characters that are entered by the user until a newline (carriage return) is encountered.
public ReadLine ( ) : string
return string

ReadLineAsSecureString() public method

Reads characters entered by the user until a newline (carriage return) is encountered and returns the characters as a secure string. In this example this functionality is not needed so the method throws a NotImplementException exception.
public ReadLineAsSecureString ( ) : System.Security.SecureString
return System.Security.SecureString

Write() public method

Writes characters to the output display of the host and specifies the foreground and background colors of the characters.
public Write ( ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value ) : void
foregroundColor ConsoleColor The color of the characters.
backgroundColor ConsoleColor The backgound color to use.
value string The characters to be written.
return void

Write() public method

Writes characters to the output display of the host.
public Write ( string value ) : void
value string The characters to be written.
return void

WriteDebugLine() public method

Writes a debug message to the output display of the host.
public WriteDebugLine ( string message ) : void
message string The debug message that is displayed.
return void

WriteErrorLine() public method

Writes an error message to the output display of the host.
public WriteErrorLine ( string message ) : void
message string The error message that is displayed.
return void

WriteLine() public method

Writes a newline character (carriage return) to the output display of the host.
public WriteLine ( ) : void
return void

WriteLine() public method

Writes a line of characters to the output display of the host with foreground and background colors and appends a newline (carriage return).
public WriteLine ( ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value ) : void
foregroundColor ConsoleColor The forground color of the display.
backgroundColor ConsoleColor The background color of the display.
value string The line to be written.
return void

WriteLine() public method

Writes a line of characters to the output display of the host and appends a newline character(carriage return).
public WriteLine ( string value ) : void
value string The line to be written.
return void

WriteProgress() public method

Writes a progress report to the output display of the host.
public WriteProgress ( long sourceId, System.Management.Automation.ProgressRecord record ) : void
sourceId long Unique identifier of the source of the record.
record System.Management.Automation.ProgressRecord A ProgressReport object.
return void

WriteVerboseLine() public method

Writes a verbose message to the output display of the host.
public WriteVerboseLine ( string message ) : void
message string The verbose message that is displayed.
return void

WriteWarningLine() public method

Writes a warning message to the output display of the host.
public WriteWarningLine ( string message ) : void
message string The warning message that is displayed.
return void