私はこれを正確にフォローしています:
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 フォーム (Web アプリケーション) の経験はあまりありませんが、MSDN の指示に従っており、かなり明確です。助言がありますか?他の誰かがこれを機能させることができますか?