Exemple #1
0
        protected async Task AddRightClickTemplatesAsync(string destinationPath, IEnumerable <ITemplateInfo> rightClickTemplates, string projectName, string projectType, string framework, string platform, string language)
        {
            // Add new items
            foreach (var item in rightClickTemplates)
            {
                GenContext.Current = new FakeContextProvider
                {
                    ProjectName          = projectName,
                    DestinationPath      = destinationPath,
                    GenerationOutputPath = GenContext.GetTempGenerationPath(projectName),
                };

                var context = new UserSelectionContext(language, platform)
                {
                    ProjectType       = projectType,
                    FrontEndFramework = framework,
                };

                var newUserSelection = new UserSelection(context)
                {
                    HomeName           = string.Empty,
                    ItemGenerationType = ItemGenerationType.GenerateAndMerge,
                };

                var templateInfo = GenContext.ToolBox.Repo.GetTemplateInfo(item, context);

                _fixture.AddItem(newUserSelection, templateInfo, BaseGenAndBuildFixture.GetDefaultName);

                await NewItemGenController.Instance.UnsafeGenerateNewItemAsync(item.GetTemplateType(), newUserSelection);

                NewItemGenController.Instance.UnsafeFinishGeneration(newUserSelection);
            }
        }
Exemple #2
0
        protected async Task AddRightClickTemplatesAsync(IEnumerable <ITemplateInfo> rightClickTemplates, string projectName, string projectType, string framework, string language)
        {
            // Add new items
            foreach (var item in rightClickTemplates)
            {
                OutputPath = GenContext.GetTempGenerationPath(projectName);

                var newUserSelection = new UserSelection(projectType, framework, language)
                {
                    HomeName           = string.Empty,
                    ItemGenerationType = ItemGenerationType.GenerateAndMerge
                };

                _fixture.AddItem(newUserSelection, item, BaseGenAndBuildFixture.GetDefaultName);

                await NewItemGenController.Instance.UnsafeGenerateNewItemAsync(item.GetTemplateType(), newUserSelection);

                NewItemGenController.Instance.UnsafeFinishGeneration(newUserSelection);
            }
        }