예제 #1
0
 public virtual void RunFinished()
 {
     _wizard = null;
     _wizardRunParameters = null;
     _isValidRun          = false;
     _project             = null;
 }
예제 #2
0
        public virtual void RunStarted(object automationObjectDte, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _isValidRun = false;

            if (runKind != WizardRunKind.AsNewItem && runKind != WizardRunKind.AsNewProject)
            {
                return;
            }
            bool isAddNewItem = runKind == WizardRunKind.AsNewItem;

            DTE dte = automationObjectDte as DTE;

            if (dte == null)
            {
                return;
            }

            var project = GetActiveProject(dte);

            if (project == null)
            {
                return;
            }

            var projectScope = GetProjectScope(project);

            if (projectScope == null)
            {
                return;
            }

            var templateFolder = GetTemplateFolder(customParams);

            if (templateFolder == null)
            {
                return;
            }

            string targetFolder = null;

            if (isAddNewItem)
            {
                targetFolder = GetTargetFolder(project);
            }

            _wizard = ResolveWizard(dte);
            if (_wizard == null)
            {
                return;
            }

            _wizardRunParameters = new WizardRunParameters(isAddNewItem, projectScope, templateFolder, targetFolder,
                                                           replacementsDictionary["$rootname$"], replacementsDictionary);
            _project = project;

            _isValidRun = RunStarted(project, _wizardRunParameters, _wizard);
        }
예제 #3
0
        protected override bool RunStarted(Project project, WizardRunParameters wizardRunParameters, TWizard wizard)
        {
            _usingMicrosoftNetSdk   = GetUsingMicrosoftNETSdk(project);
            _enableSimulatedItemAdd =
                wizardRunParameters.IsAddNewItem &&
                _usingMicrosoftNetSdk &&
                wizardRunParameters.TargetFolder != null;

            if (_enableSimulatedItemAdd)
            {
                Logger?.LogVerbose($"Using simulated item add for project '{project.Name}'");
            }

            return(base.RunStarted(project, wizardRunParameters, wizard));
        }
예제 #4
0
 protected virtual bool RunStarted(Project project, WizardRunParameters wizardRunParameters, TWizard wizard)
 {
     return(wizard.RunStarted(wizardRunParameters));
 }