RootWizard.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using EnvDTE;
  7. using Microsoft.VisualStudio.TemplateWizard;
  8. namespace UrhoSharpTemplateWizard
  9. {
  10. public class RootWizard : IWizard
  11. {
  12. // Use to communicate $saferootprojectname$ to ChildWizard
  13. public static Dictionary<string, string> GlobalDictionary =
  14. new Dictionary<string, string>();
  15. // Add global replacement parameters
  16. public void RunStarted(object automationObject,
  17. Dictionary<string, string> replacementsDictionary,
  18. WizardRunKind runKind, object[] customParams)
  19. {
  20. // Place "$saferootprojectname$ in the global dictionary.
  21. // Copy from $safeprojectname$ passed in my root vstemplate
  22. GlobalDictionary["$saferootprojectname$"] = replacementsDictionary["$safeprojectname$"];
  23. }
  24. public void RunFinished()
  25. {
  26. }
  27. public void BeforeOpeningFile(ProjectItem projectItem)
  28. {
  29. }
  30. public void ProjectFinishedGenerating(Project project)
  31. {
  32. }
  33. public bool ShouldAddProjectItem(string filePath)
  34. {
  35. return true;
  36. }
  37. public void ProjectItemFinishedGenerating(ProjectItem projectItem)
  38. {
  39. }
  40. }
  41. }