Makes use of a script block to create an <input> task similar to the one provided by Ant. You supply a meesage prompt and the property that should be updated / created with the users input.
<script language="C#" prefix="custom" >
<references>
<include name="Microsoft.VisualBasic.dll" />
</references>
<code>
<![CDATA[
[TaskName("input")]
public class InputTask : Task
{
private string _message;
private string _addProperty;
[TaskAttribute("message", Required=true)]
public string Message
{
get { return _message; }
set { _message = value; }
}
[TaskAttribute("addproperty", Required=true)]
public string AddProperty
{
get { return _addProperty; }
set { _addProperty = value; }
}
protected override void ExecuteTask()
{
string propertyValue = Microsoft.VisualBasic.Interaction.InputBox(
Message, "User Input Required", "", -1, -1);
if(Properties.Contains(AddProperty) == true)
{
Properties[AddProperty] = propertyValue;
}
else
{
Properties.Add(AddProperty, propertyValue);
}
}
}
]]>
</code>
</script>