Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/tools/Templates/HeuristicLabVS2010Wizards/ViewWizard.cs @ 4147

Last change on this file since 4147 was 4146, checked in by abeham, 14 years ago

#567

  • Added View Wizard, Wizards GAC installer, and view template
  • Sometimes it works, sometimes it doesn't
File size: 1.2 KB
Line 
1using System.Collections.Generic;
2using EnvDTE;
3using Microsoft.VisualStudio.TemplateWizard;
4
5namespace HeuristicLab.VS2010Wizards {
6  public class ViewWizard : IWizard {
7    ViewWizardForm form;
8    bool shouldAddItem;
9
10    #region IWizard Members
11
12    public void BeforeOpeningFile(ProjectItem projectItem) {
13    }
14
15    public void ProjectFinishedGenerating(Project project) {
16    }
17
18    public void ProjectItemFinishedGenerating(ProjectItem projectItem) {
19    }
20
21    public void RunFinished() {
22    }
23
24    public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) {
25      form = new ViewWizardForm();
26      if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
27        replacementsDictionary.Add("$baseClass$", form.BaseClass);
28        replacementsDictionary.Add("$viewContentType$", form.ViewContentType);
29        replacementsDictionary.Add("$isDefaultView$", form.IsDefaultView.ToString().ToLower());
30        shouldAddItem = true;
31      } else shouldAddItem = false;
32    }
33
34    public bool ShouldAddProjectItem(string filePath) {
35      return shouldAddItem;
36    }
37
38    #endregion
39  }
40}
Note: See TracBrowser for help on using the repository browser.