Я точно следую этому:
http://msdn.microsoft.com/en-us/library/ms185301.aspx
но не могу заставить его работать. Форма появляется, когда я пытаюсь добавить свой новый элемент, но когда я ввожу текст и нажимаю кнопку, ничего не происходит.
Для потомков вот мой код:
Непустые методы в классе Wizard, который расширяет IWizard
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
{
try
{
// Display a form to the user. The form collects
// input for the custom message.
inputForm = new UserInputForm();
inputForm.ShowDialog();
customMessage = inputForm.get_CustomMessage();
// Add custom parameters.
replacementsDictionary.Add("$custommessage$",
customMessage);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
// This method is only called for item templates,
// not for project templates.
public bool ShouldAddProjectItem(string filePath)
{
return true;
}
Код формы ввода пользователя:
public partial class UserInputForm : Form
{
private string customMessage;
public UserInputForm()
{
InitializeComponent();
}
public string get_CustomMessage()
{
return customMessage;
}
private void button1_Click(object sender, EventArgs e)
{
customMessage = textBox1.Text;
this.Dispose();
}
}
И кнопка действительно называется кнопкой 1:
this.button1.Location = new System.Drawing.Point(200, 180);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(100, 40);
this.button1.TabIndex = 0;
this.button1.Text = "Click Me";
this.button1.UseVisualStyleBackColor = true;
Так что у меня нет большого опыта работы с Windows Forms (веб-приложениями), но я следую указаниям в MSDN, и это довольно четко. Какие-либо предложения? Кто-нибудь еще может заставить это работать?