Console Class | MSBuild Extension Pack Help 4.0.12.0 |
Valid TaskActions are:
Beep (Optional: Title, Repeat, Duration, Frequency, Interval)
ReadLine (Optional: Title, UserPrompt, ToLower, ToUpper Output: UserResponse)
Remote Execution Support: No
Inheritance Hierarchy
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.UIConsole
Namespace: MSBuild.ExtensionPack.UI
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The Console type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Console |
Properties
Name | Description | |
---|---|---|
![]() | Duration |
Sets the duration. Default is 333ms. Value must be between 1 and 10000
|
![]() | Frequency |
Sets the frequency. Default is 600hz. Value must be between 37 and 32767
|
![]() | Interval |
Sets the interval between beebs. Default is 10ms. Value must be between 10 and 5000
|
![]() | Repeat |
Sets the repeat. Default is 1. Value must be between 1 and 20
|
![]() | Title |
Set the title of the console
|
![]() | ToLower |
Sets the UserResponse to lower text
|
![]() | ToUpper |
Sets the UserResponse to uppper text
|
![]() | UserPrompt |
The message to prompt the user for input. Default is "Please enter a response and press [Enter]:"
|
![]() | UserResponse |
Gets the response that the user typed
|
Examples
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <Target Name="Default"> <!-- Read input from the user --> <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine"> <Output TaskParameter="UserResponse" PropertyName="Line"/> </MSBuild.ExtensionPack.UI.Console> <Message Text="User Typed: $(Line)"/> <!-- Read input from the user and uppercase it all --> <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine" UserPrompt="Please enter your password and press the [Enter] key" ToUpper="true"> <Output TaskParameter="UserResponse" PropertyName="Line"/> </MSBuild.ExtensionPack.UI.Console> <Message Text="User Typed: $(Line)"/> <!-- Play some beeps --> <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3"/> <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="4" Duration="500" Frequency="1000"/> <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3" Interval="2000"/> </Target> </Project>
See Also