Dialog Class

MSBuild Extension Pack

Dialog Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

Confirm (Required: Text Optional: Title, Height, Width, ConfirmText, ErrorText, ErrorTitle, Button1Text, Button2Text, MaskText Output: ButtonClickedText, UserText)

Show (Required: Text Optional: Title, Height, Width, Button1Text, Button2Text, Button3Text, MessageColour, MessageBold Output: ButtonClickedText)

Prompt (Required: Text Optional: Title, Height, Width, Button1Text, Button2Text, Button3Text, MessageColour, MessageBold, MaskText Output: ButtonClickedText, UserText)

Remote Execution Support: NA

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.UIDialog

Namespace: MSBuild.ExtensionPack.UI
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The Dialog type exposes the following members.

Constructors

  NameDescription
Public methodDialog
Top
Properties

  NameDescription
Public propertyButton1Text
Sets the text for Button1. Default is 'Ok'
Public propertyButton2Text
Sets the text for Button2. If no text is set the button will not be displayed
Public propertyButton3Text
Set the text for Button3. If no text is set the button will not be displayed
Public propertyButtonClickedText
Gets the text of the button that the user clicked
Public propertyConfirmText
Sets the confirmation text for the message that is displayed. Default is 'Confirm'
Public propertyErrorText
Sets the text for the error messagebox if Confirm fails. Default is 'The supplied values do not match'
Public propertyErrorTitle
Sets the title for the error messagebox if Confirm fails. Default is 'Error'
Public propertyHeight
Sets the height of the form. Default is 180
Public propertyMaskText
Set to true to use the default password character to mask the user input
Public propertyMessageBold
Sets whether the message text is bold. Default is false.
Public propertyMessageColour
Sets the message text colour. Default is ControlText (usually black).
Public propertyText
Sets the text for the message that is displayed
Public propertyTitle
Sets the Title of the Dialog. Default is 'Message' for Show and Prompt, 'Confirm' for Confirm TaskAction
Public propertyUserText
Gets the text that the user typed into the Prompt
Public propertyWidth
Sets the width of the form. Default is 400
Top
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">
        <!-- Confirm a Password -->
        <MSBuild.ExtensionPack.UI.Dialog TaskAction="Confirm" Title="Confirmation Required" Button2Text="Cancel" Text="Enter Password" ConfirmText="Confirm Password" MaskText="true">
            <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
            <Output TaskParameter="UserText" PropertyName="Typed"/>
        </MSBuild.ExtensionPack.UI.Dialog>
        <Message Text="User Clicked: $(Clicked)"/>
        <Message Text="User Typed: $(Typed)"/>
        <!-- A simple message -->
        <MSBuild.ExtensionPack.UI.Dialog TaskAction="Show" Text="Hello MSBuild">
            <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
        </MSBuild.ExtensionPack.UI.Dialog>
        <Message Text="User Clicked: $(Clicked)"/>
        <!-- A longer message with a few more attributes set -->
        <MSBuild.ExtensionPack.UI.Dialog TaskAction="Show" Title="A Longer Message" MessageBold="True" Button2Text="Cancel" MessageColour="Green" Height="300" Width="600" Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras vitae velit. Pellentesque malesuada diam eget sem. Praesent vestibulum. Donec egestas, quam at viverra volutpat, eros nulla gravida nisi, sed bibendum metus mauris ut diam. Aliquam interdum lacus nec quam. Etiam porta, elit sed pretium vestibulum, nisi dui condimentum enim, ut rhoncus ipsum leo nec est. Nullam congue velit id ligula. Sed imperdiet bibendum pede. In hac habitasse platea dictumst. Praesent eleifend, elit quis convallis aliquam, mi arcu feugiat sem, at blandit mauris nisi eget mauris.">
            <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
        </MSBuild.ExtensionPack.UI.Dialog>
        <Message Text="User Clicked: $(Clicked)"/>
        <!-- A simple prompt for input -->
        <MSBuild.ExtensionPack.UI.Dialog TaskAction="Prompt" Title="Information Required" Button2Text="Cancel" Text="Please enter your Name below">
            <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
            <Output TaskParameter="UserText" PropertyName="Typed"/>
        </MSBuild.ExtensionPack.UI.Dialog>
        <Message Text="User Clicked: $(Clicked)"/>
        <Message Text="User Typed: $(Typed)"/>
        <!-- A prompt for password input -->
        <MSBuild.ExtensionPack.UI.Dialog TaskAction="Prompt" Title="Sensitive Information Required" Button2Text="Cancel" Text="Please enter your Password below" MessageColour="Red" MaskText="true">
            <Output TaskParameter="ButtonClickedText" PropertyName="Clicked"/>
            <Output TaskParameter="UserText" PropertyName="Typed"/>
        </MSBuild.ExtensionPack.UI.Dialog>
        <Message Text="User Clicked: $(Clicked)"/>
        <Message Text="User Typed: $(Typed)"/>
    </Target >
</Project>
See Also

Reference