PageRenderTime 28ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Main/SPALM.SharePointSoftwareFactory.Library/CustomWizardPages/TemplateTypeSelectionPage.cs

#
C# | 101 lines | 79 code | 16 blank | 6 comment | 3 complexity | 9785b9b1803fb65e397448a8bb99699b MD5 | raw file
  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Windows.Forms;
  6. using Microsoft.Practices.WizardFramework;
  7. using System.ComponentModel.Design;
  8. using EnvDTE;
  9. using System.IO;
  10. namespace SPALM.SharePointSoftwareFactory.Library.CustomWizardPages
  11. {
  12. /// <summary>
  13. /// Example of a class that is a custom wizard page
  14. /// </summary>
  15. public partial class TemplateTypeSelectionPage : SPSFBaseWizardPage
  16. {
  17. public TemplateTypeSelectionPage(WizardForm parent)
  18. : base(parent)
  19. {
  20. // This call is required by the Windows Form Designer.
  21. InitializeComponent();
  22. }
  23. public override void BeginInit()
  24. {
  25. base.BeginInit();
  26. SetValues();
  27. }
  28. private void CheckVisibility()
  29. {
  30. if (!HasBeenActivated)
  31. {
  32. DTE dte = GetService(typeof(DTE)) as DTE;
  33. //template selection is not possible in
  34. //vs 2008
  35. if (!dte.Version.StartsWith("10."))
  36. {
  37. radioButton_Hive.Checked = true;
  38. radioButton_VSeWSS.Checked = false;
  39. radioButton_VSeWSS.Enabled = false;
  40. label3.Enabled = false;
  41. pictureBox2.Enabled = false;
  42. }
  43. }
  44. }
  45. public override bool OnActivate()
  46. {
  47. base.OnActivate();
  48. CheckVisibility();
  49. AddBrandingPanel();
  50. HasBeenActivated = true;
  51. return true;
  52. }
  53. private void pictureBox2_Click(object sender, EventArgs e)
  54. {
  55. this.radioButton_VSeWSS.Checked = true;
  56. }
  57. private void pictureBox1_Click(object sender, EventArgs e)
  58. {
  59. this.radioButton_Hive.Checked = true;
  60. }
  61. private void radioButton_VSeWSS_CheckedChanged(object sender, EventArgs e)
  62. {
  63. SetValues();
  64. }
  65. private void SetValues()
  66. {
  67. try
  68. {
  69. IDictionaryService dictionaryService = GetService(typeof(IDictionaryService)) as IDictionaryService;
  70. dictionaryService.SetValue("IsVSEWSSTemplate", radioButton_VSeWSS.Checked);
  71. dictionaryService.SetValue("IsHIVETemplate", radioButton_Hive.Checked);
  72. }
  73. catch { }
  74. }
  75. private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  76. {
  77. string pathToHelpPage = Path.Combine(GetBasePath(), @"Help\OutputHTML\SPSF_OVERVIEW_600_ProjectTypes.html");
  78. if(File.Exists(pathToHelpPage))
  79. {
  80. DTE dte = GetService(typeof(DTE)) as DTE;
  81. Helpers.OpenWebPage(dte, pathToHelpPage);
  82. }
  83. }
  84. }
  85. }