Ejemplo n.º 1
0
 private void ClearValues()
 {
     tbCurrentSolution.Text = "";
     tbNewLocation.Text = "";
     tbNewSolutionName.Text = "";
     tbPackageName.Text = "ClientPackage";
     tbSolutionName.Text = "";
     cbBaseForm.Text = "CSingle";
     tbFormName.Text = "Form1";
     tbAssemblyOutputPath.Text = "";
     cbColumnCount.SelectedIndex = 0;
     rbAddToExistSln_Click(rbAddToExistSln, null);
     tvContainer.Nodes.Clear();
     rbEEPBaseForm.Checked = false;
     rbEEPBaseForm.Checked = true;
     cbBindingSource.Enabled = false;
     cbViewBindingSource.Enabled = false;
     btnAddField.Enabled = false;
     btnDeleteField.Enabled = false;
     FTemplateForm = null;
     ClearFormData();
 }
Ejemplo n.º 2
0
 private void OpenTemplateForm()
 {
     FTemplateForm = null;
     foreach (Project P in FDTE2.Solution.Projects)
     {
         if (P.Name.CompareTo("Template") == 0 && P.Kind == "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}")
         {
             foreach (ProjectItem PI in P.ProjectItems)
             {
                 if (PI.Name.CompareTo(cbBaseForm.Text) == 0)
                 {
                     if (PI.SubProject != null)
                     {
                         foreach (ProjectItem FormPI in PI.SubProject.ProjectItems)
                         {
                             if (FormPI.Name.CompareTo("Form1." + FClientData.Language) == 0)
                             {
                                 Window W = FormPI.Open("{00000000-0000-0000-0000-000000000000}");
                                 IDesignerHost aDesignerHost = (IDesignerHost)W.Object;
                                 FTemplateForm = (System.Windows.Forms.Form)aDesignerHost.RootComponent as InfoForm;
                                 break;
                             }
                         }
                     }
                     break;
                 }
             }
         }
     }
     if (FTemplateForm == null)
     {
         MessageBox.Show(String.Format("Cannot open template form [Form1] of project [{0}] !", cbBaseForm.Text));
         throw new Exception("");
     }
 }