Exemplo n.º 1
0
        public override void GenerateCode()
        {
            FrameworkDependencyStatus installNotNeeded = FrameworkDependencyStatus.InstallNotNeeded; //JF

            if (!this.Framework.IsDependencyInstalled(base.Context))
            {
                installNotNeeded = this.Framework.EnsureDependencyInstalled(base.Context);
            }
            else
            {
                base.Context.AddTelemetryData("DependencyScaffolderOptions", (uint)1);
            }
            this.Scaffold();
            if (installNotNeeded.IsNewDependencyInstall)
            {
                this.Framework.UpdateConfiguration(base.Context);
            }
            if (this.Model.OutputFileFullPath != null)
            {
                this.VisualStudioIntegration.Editor.OpenFileInEditor(this.Model.OutputFileFullPath);
            }
            if (installNotNeeded.IsReadmeRequired)
            {
                this.VisualStudioIntegration.Editor.CreateAndOpenReadme(installNotNeeded.ReadmeText);
            }
            this.SaveSettings(this.Model);
            foreach (NuGetPackage runtimePackage in this.RuntimePackages)
            {
                base.Context.Packages.Add(runtimePackage);
            }
        }
 static FrameworkDependencyStatus()
 {
     FrameworkDependencyStatus.InstallSuccessful = new FrameworkDependencyStatus()
     {
         IsNewDependencyInstall = true
     };
     FrameworkDependencyStatus.InstallNotNeeded = new FrameworkDependencyStatus();
 }
Exemplo n.º 3
0
        protected override FrameworkDependencyStatus GenerateConfiguration()
        {
            if (base.TryCreateGlobalAsax())
            {
                return(FrameworkDependencyStatus.InstallSuccessful);
            }
            MvcFullDependencyReadMe mvcFullDependencyReadMe = new MvcFullDependencyReadMe(ProjectExtensions.GetCodeLanguage(base.Context.ActiveProject), base.Context.ActiveProject.Name, base.AppStartFileNames);

            return(FrameworkDependencyStatus.FromReadme(mvcFullDependencyReadMe.CreateReadMeText()));
        }
        public static FrameworkDependencyStatus FromReadme(string text)
        {
            if (text == null)
            {
                throw new ArgumentNullException("text");
            }
            FrameworkDependencyStatus frameworkDependencyStatu = new FrameworkDependencyStatus()
            {
                IsNewDependencyInstall = true,
                IsReadmeRequired       = true,
                ReadmeText             = text
            };

            return(frameworkDependencyStatu);
        }