从向导中取消 VS2010 项目创建
我在 VS2010 中为自定义模板创建了一个向导 它就像一个魅力。
但由于向导包含完成项目创建所需的表单,因此我认为用户应该能够取消项目的创建。
所以我的问题是..
是否可以从实现 IWizard 的向导内部取消项目/模板流程的创建?
这些是我可以处理的事件。
public void BeforeOpeningFile(ProjectItem projectItem)
public void ProjectFinishedGenerating(Project project)
public void ProjectItemFinishedGenerating(ProjectItem projectItem)
public void RunFinished()
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
public bool ShouldAddProjectItem(string filePath)
谢谢你!
I created a wizard for a custom template in VS2010
And it works like a charm.
But since the wizard contains a form required to finish the creation of the project, i feel that the user should be able to cancel the creation of the project.
So my question being..
Is it possible to cancel the creation of a project/template process from inside a wizard implementing IWizard?
These are the events i got at my disposal.
public void BeforeOpeningFile(ProjectItem projectItem)
public void ProjectFinishedGenerating(Project project)
public void ProjectItemFinishedGenerating(ProjectItem projectItem)
public void RunFinished()
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
public bool ShouldAddProjectItem(string filePath)
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。要指示用户已取消向导,只需抛出一个新的
一篇非常有趣的文章解释了这一切:在 IWizard 中取消 VSIX 项目模板的陷阱
Yes. To indicate that the user has cancelled the wizard, just throw a new WizardCancelledException in your IWizard implementation.
A very interesting article which explains all this: Pitfalls of cancelling a VSIX project template in an IWizard