예제 #1
0
 public string createFromT4Template(UI5ProjectType type)
 {
     var jsonTemplate = new T4.JSONView
     {
         Session =
             new Dictionary<string, object>
             {
                 {"ControllerName", this.ControllerName},
                 {"IsMobile", type == UI5ProjectType.Mobile}
             }
     };
     jsonTemplate.Initialize();
     return jsonTemplate.TransformText();
 }
예제 #2
0
 public static string createContentFromT4(UI5ProjectType type, string viewExtension, string mainControllerName)
 {
     var jsonTemplate = new T4.Index
     {
         Session =
             new Dictionary<string, object>
             {
                 {"ControllerName", mainControllerName},
                 {"IsMobile", type == UI5ProjectType.Mobile},
                 {"ViewExtension", viewExtension}
             }
     };
     jsonTemplate.Initialize();
     return jsonTemplate.TransformText();
 }
예제 #3
0
        public string createFromT4Template(UI5ProjectType type)
        {
            var htmlTemplate = new T4.HTMLView
            {
                Session =
                    new Dictionary <string, object>
                {
                    { "ControllerName", this.ControllerName },
                    { "IsMobile", type == UI5ProjectType.Mobile }
                }
            };

            htmlTemplate.Initialize();
            return(htmlTemplate.TransformText());
        }
예제 #4
0
        public static string createContentFromT4(UI5ProjectType type, string viewExtension, string mainControllerName)
        {
            var jsonTemplate = new T4.Index
            {
                Session =
                    new Dictionary <string, object>
                {
                    { "ControllerName", mainControllerName },
                    { "IsMobile", type == UI5ProjectType.Mobile },
                    { "ViewExtension", viewExtension }
                }
            };

            jsonTemplate.Initialize();
            return(jsonTemplate.TransformText());
        }
 /// <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>
 /// <exception cref="Microsoft.VisualStudio.TemplateWizard.WizardBackoutException"></exception>
 public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     this.mForm = new UI5AppWizard();
     this.mForm.ShowDialog();
     if (this.mForm.DialogResult == DialogResult.Cancel)
     {
         var destinationDirectory = replacementsDictionary["$destinationdirectory$"];
         if (Directory.Exists(destinationDirectory))
         {
             Directory.Delete(destinationDirectory, true);
         }
         throw new WizardBackoutException();
     }
     this.mDTE      = automationObject as DTE;
     this.mRootPath = replacementsDictionary["$safeprojectname$"].ToLowerInvariant()
                      .Replace(" ", string.Empty);
     replacementsDictionary.Add("$rootmodulepath$", this.mRootPath);
     this.mView = this.mForm.SelectedView(this.mRootPath + ".Main");
     this.mType = this.mForm.SelectedProject;
 }
 /// <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>
 /// <exception cref="Microsoft.VisualStudio.TemplateWizard.WizardBackoutException"></exception>
 public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     this.mForm = new UI5AppWizard();
     this.mForm.ShowDialog();
     if (this.mForm.DialogResult == DialogResult.Cancel)
     {
         var destinationDirectory = replacementsDictionary["$destinationdirectory$"];
         if (Directory.Exists(destinationDirectory))
         {
             Directory.Delete(destinationDirectory, true);
         }
         throw new WizardBackoutException();
     }
     this.mDTE = automationObject as DTE;
     this.mRootPath = replacementsDictionary["$safeprojectname$"].ToLowerInvariant()
         .Replace(" ", string.Empty);
     replacementsDictionary.Add("$rootmodulepath$", this.mRootPath);
     this.mView = this.mForm.SelectedView(this.mRootPath + ".Main");
     this.mType = this.mForm.SelectedProject;
 }
 /// <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)
 {
     this.mForm = new UI5AppWizard();
     this.mForm.ShowDialog();
     if (this.mForm.DialogResult == DialogResult.Cancel)
     {
         var destinationDirectory = replacementsDictionary["$destinationdirectory$"];
         if (Directory.Exists(destinationDirectory))
         {
             Directory.Delete(destinationDirectory, true);
         }
         throw new WizardBackoutException();
     }
     this.mDTE = automationObject as DTE;
     var ns = replacementsDictionary["$rootnamespace$"];
     this.mRootPath = ns.Substring(ns.IndexOf('.') + 1);
     this.mControllerName = replacementsDictionary["$safeitemname$"].ToLowerInvariant();
     replacementsDictionary.Add("$rootmodulepath$", this.mRootPath);
     replacementsDictionary.Add("$controllername$", this.mControllerName);
     this.mView = this.mForm.SelectedView(this.mRootPath + "." + this.mControllerName);
     this.mType = this.mForm.SelectedProject;
 }
        /// <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)
        {
            this.mForm = new UI5AppWizard();
            this.mForm.ShowDialog();
            if (this.mForm.DialogResult == DialogResult.Cancel)
            {
                var destinationDirectory = replacementsDictionary["$destinationdirectory$"];
                if (Directory.Exists(destinationDirectory))
                {
                    Directory.Delete(destinationDirectory, true);
                }
                throw new WizardBackoutException();
            }
            this.mDTE = automationObject as DTE;
            var ns = replacementsDictionary["$rootnamespace$"];

            this.mRootPath       = ns.Substring(ns.IndexOf('.') + 1);
            this.mControllerName = replacementsDictionary["$safeitemname$"].ToLowerInvariant();
            replacementsDictionary.Add("$rootmodulepath$", this.mRootPath);
            replacementsDictionary.Add("$controllername$", this.mControllerName);
            this.mView = this.mForm.SelectedView(this.mRootPath + "." + this.mControllerName);
            this.mType = this.mForm.SelectedProject;
        }