From the "Project template parameterization (below)" to the present, we have applied the IWizard interface to the sub-project WebClient. The actual situation is, how do we customize each project or change the angle, here we have three template metadata files, each of which can define and configure the node WizardExtension.
1. Use LifeCycleTracerIWizard to track multiple sub-projects in multiple project templates
Reconfigure the WizardExtension nodes of the three template metadata files as follows (do not configure ChainingLifeCycleTracerIWizard first ):
<WizardExtension>
<Assembly>Ethan.Woo.TemplateWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e82b5e824e88ddd5</Assembly>
<FullClassName>Ethan.Woo.TemplateWizard.LifeCycleTracerIWizard</FullClassName>
</WizardExtension>
Can this result show the rule? Regular! See my analysis:
1) the blue part is a Solution-level trace, that is, the scope of the WizardExtension configured in the root project metadata file. The execution process is RunStarted-> ProjectFinishedGenerating-> RunFinished. ShouldAddProjectItem is not executed because it only contains sub-projects, not source files.
2) the green and yellow parts are the tracking of IWizard instances created during the instantiation of The WebClient and DataService project templates. The tracking result is exactly the same as that in the previous article.
3) The execution of the IWizard interface method specified in the configuration of the root project metadata file is separated by the IWizard life cycle of the quilt project in the execution sequence, the third parameter of RunStarted is the WizardRunKind in the previous article. asMultiProject, indicating that the current execution is the template instantiation of multiple projects. Note that Ethan is used in all three configurations. woo. templateWizard. lifeCycleTracerIWizard, but three instances are instantiated. They are all IWizard instances. In a sense, the life cycle of the IWizard interface corresponding to the root project metadata file is implemented, is the longest.
Here I give my own summary illustration, which intuitively expresses the previous results:
2. Connect ChainingLifeCycleTracerIWizard
Let's take a look at the result of ChainingLifeCycleTracerIWizard concatenating three template metadata files. It's easy. I will not explain it much.
Iii. Automation of IWizard and Visual Studio.
Note that the first parameter of the RunStarted method is an Object. In fact, for the host of Visual Studio 2010, the actual Object type is DTE2. Using this model, we can operate Visual Studio, a powerful IDE, to complete complex logic operations. We will not discuss this topic here. We only provide two MSDN links:
Extending the Visual Studio Environment: http://msdn.microsoft.com/zh-cn/library/esk3eey8.aspx
Automation and Extensibility Reference: http://msdn.microsoft.com/zh-cn/library/1xt0ezx9.aspx
Let's have an in-depth discussion of the IWizard interface. Here, we can customize our own implementation based on our needs, you can even customize a complete set of frameworks for building our complex project templates. Of course, the most complex project template is actually called Starter Kits, which is an enhanced version of a common project template.
From: http://www.ethan-woo.com/post/2011/05/03/Deep-into-IWizard-Second.aspx