/// <summary>
 /// Gets the form values from the wizard, and set them into the base private fields.
 /// </summary>
 /// <param name="form">The wizard form.</param>
 private void GetFormValues(ItemTemplatesWebWizard form)
 {
     _selectedModel        = form.SelectedModel;
     _selectedEntity       = form.SelectedEntity;
     _selectedTables       = form.SelectedTables;
     _dataAccessTechnology = form.DataAccessTechnology;
 }
 /// <summary>
 /// Runs custom wizard logic at the beginning of a template wizard run.
 /// </summary>
 /// <param name="automationObject">The automation object being used by the template wizard.</param>
 /// <param name="replacementsDictionary">The list of standard parameters to be replaced.</param>
 /// <param name="runKind">A <see cref="T:Microsoft.VisualStudio.TemplateWizard.WizardRunKind" /> indicating the type of wizard run.</param>
 /// <param name="customParams">The custom parameters with which to perform parameter replacement in the project.</param>
 public void RunStarted(Object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, Object[] customParams)
 {
     try
     {
         dte = automationObject as DTE;
         Array   activeProjects = (Array)dte.ActiveSolutionProjects;
         Project activeProj     = (Project)activeProjects.GetValue(0);
         _projectPath          = System.IO.Path.GetDirectoryName(activeProj.FullName);
         _projectNamespace     = activeProj.Properties.Item("DefaultNamespace").Value.ToString();
         _NetFxVersion         = replacementsDictionary["$targetframeworkversion$"];
         _itemTemplateTempPath = customParams[0].ToString().Substring(0, customParams[0].ToString().LastIndexOf("\\"));
         ItemTemplatesWebWizard form = new ItemTemplatesWebWizard(_language, dte, _projectType);
         form.StartPosition = FormStartPosition.CenterScreen;
         DialogResult result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             GetFormValues(form);
             string providerConnectionString = ItemTemplateUtilities.GetProviderConnectionString(_selectedModel, dte, false);
             if (!string.IsNullOrEmpty(providerConnectionString))
             {
                 _connectionString = providerConnectionString;
                 _connectionName   = ItemTemplateUtilities.GetConnectionStringName(_selectedModel, dte, false);
                 _connection       = new MySqlConnection(_connectionString);
             }
         }
     }
     catch (WizardCancelledException wce)
     {
         throw wce;
     }
     catch (Exception e)
     {
         SendToGeneralOutputWindow(string.Format("An error occurred: {0}\n\n {1}", e.Message, e.StackTrace));
     }
 }