当前位置: 首页>>代码示例>>C#>>正文


C# IDeploymentSettingsManager.GetValue方法代码示例

本文整理汇总了C#中IDeploymentSettingsManager.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IDeploymentSettingsManager.GetValue方法的具体用法?C# IDeploymentSettingsManager.GetValue怎么用?C# IDeploymentSettingsManager.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDeploymentSettingsManager的用法示例。


在下文中一共展示了IDeploymentSettingsManager.GetValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoSwapHandler

 public AutoSwapHandler(IDeploymentStatusManager deploymentStatusManager, IEnvironment environment, IDeploymentSettingsManager settings, ITraceFactory traceFactory)
 {
     _deploymentStatusManager = deploymentStatusManager;
     _traceFactory = traceFactory;
     _autoSwapSlotName = settings.GetValue("WEBSITE_SWAP_SLOTNAME");
     _autoSwapLockFilePath = Path.Combine(environment.LocksPath, AutoSwapLockFile);
 }
开发者ID:Walk4Muscle,项目名称:kudu,代码行数:7,代码来源:AutoSwapHandler.cs

示例2: GetCurrentSiteBuilderFactory

        private ISiteBuilderFactory GetCurrentSiteBuilderFactory(IDeploymentSettingsManager settingsManager)
        {
            string setting = settingsManager.GetValue(SettingsKeys.SiteBuilderFactory);
            if (String.Equals(setting, Original, StringComparison.OrdinalIgnoreCase))
            {
                return _originalSiteBuilderFactory;
            }

            // Default
            return _generatorSiteBuilderFactory;
        }
开发者ID:richardprice,项目名称:kudu,代码行数:11,代码来源:SiteBuilderFactoryDispatcher.cs

示例3: GetTimeSpan

        private static TimeSpan GetTimeSpan(IDeploymentSettingsManager settings, string settingsKey, TimeSpan defaultValue)
        {
            string value = settings.GetValue(settingsKey);
            int seconds;
            if (Int32.TryParse(value, out seconds))
            {
                return TimeSpan.FromSeconds(seconds >= 0 ? seconds : 0);
            }

            return defaultValue;
        }
开发者ID:40a,项目名称:kudu,代码行数:11,代码来源:DeploymentSettingsExtension.cs

示例4: CreateBuilder

        public ISiteBuilder CreateBuilder(ITracer tracer, ILogger logger, IDeploymentSettingsManager settings)
        {
            string repositoryRoot = _environment.RepositoryPath;

            // If there's a custom deployment file then let that take over.
            var command = settings.GetValue(SettingsKeys.Command);
            if (!String.IsNullOrEmpty(command))
            {
                return new CustomBuilder(repositoryRoot, _environment.TempPath, command, _propertyProvider, _environment.SiteRootPath, _environment.ScriptPath, settings);
            }

            // If the repository has an explicit pointer to a project path to be deployed
            // then use it.
            var targetProjectPath = settings.GetValue(SettingsKeys.Project);
            if (!String.IsNullOrEmpty(targetProjectPath))
            {
                tracer.Trace("Found .deployment file in repository");

                targetProjectPath = Path.GetFullPath(Path.Combine(repositoryRoot, targetProjectPath.TrimStart('/', '\\')));

                // Try to resolve the project
                return ResolveProject(repositoryRoot,
                                      targetProjectPath,
                                      settings,
                                      tryWebSiteProject: true,
                                      searchOption: SearchOption.TopDirectoryOnly);
            }

            // Get all solutions in the current repository path
            var solutions = VsHelper.GetSolutions(repositoryRoot).ToList();

            if (!solutions.Any())
            {
                return ResolveProject(repositoryRoot,
                                      settings,
                                      searchOption: SearchOption.AllDirectories);
            }

            // More than one solution is ambiguous
            if (solutions.Count > 1)
            {
                // TODO: Show relative paths in error messages
                ThrowAmbiguousSolutionsError(solutions);
            }

            // We have a solution
            VsSolution solution = solutions[0];

            // We need to determine what project to deploy so get a list of all web projects and
            // figure out with some heuristic, which one to deploy.

            // TODO: Pick only 1 and throw if there's more than one
            VsSolutionProject project = solution.Projects.Where(p => p.IsWap || p.IsWebSite).FirstOrDefault();

            if (project == null)
            {
                logger.Log(Resources.Log_NoDeployableProjects, solution.Path);

                return new BasicBuilder(repositoryRoot, _environment.ScriptPath, _environment.SiteRootPath, settings);
            }

            if (project.IsWap)
            {
                return new WapBuilder(settings,
                                      _propertyProvider,
                                      repositoryRoot,
                                      project.AbsolutePath,
                                      _environment.TempPath,
                                      solution.Path);
            }

            return new WebSiteBuilder(_propertyProvider,
                                      repositoryRoot,
                                      project.AbsolutePath,
                                      solution.Path,
                                      settings);
        }
开发者ID:KoprowskiT,项目名称:kudu,代码行数:77,代码来源:SiteBuilderFactory.cs

示例5: CreateBuilder

        public ISiteBuilder CreateBuilder(ITracer tracer, ILogger logger, IDeploymentSettingsManager settings, IFileFinder fileFinder)
        {
            string repositoryRoot = _environment.RepositoryPath;

            // Use the cached vs projects file finder for: a. better performance, b. ignoring solutions/projects under node_modules
            fileFinder = new CachedVsProjectsFileFinder(fileFinder);

            // If there's a custom deployment file then let that take over.
            var command = settings.GetValue(SettingsKeys.Command);
            if (!String.IsNullOrEmpty(command))
            {
                return new CustomBuilder(_environment, settings, _propertyProvider, repositoryRoot, command);
            }

            // If the user provided specific generator arguments, that overrides any detection logic
            string scriptGeneratorArgs = settings.GetValue(SettingsKeys.ScriptGeneratorArgs);
            if (!String.IsNullOrEmpty(scriptGeneratorArgs))
            {
                return new CustomGeneratorCommandSiteBuilder(_environment, settings, _propertyProvider, repositoryRoot, scriptGeneratorArgs);
            }

            // If the repository has an explicit pointer to a project path to be deployed
            // then use it.
            string targetProjectPath = settings.GetValue(SettingsKeys.Project);
            if (!String.IsNullOrEmpty(targetProjectPath))
            {
                tracer.Trace("Specific project was specified: " + targetProjectPath);

                targetProjectPath = Path.GetFullPath(Path.Combine(repositoryRoot, targetProjectPath.TrimStart('/', '\\')));

                // Try to resolve the project
                return ResolveProject(repositoryRoot,
                                      targetProjectPath,
                                      settings,
                                      fileFinder,
                                      tryWebSiteProject: true,
                                      searchOption: SearchOption.TopDirectoryOnly);
            }

            // Get all solutions in the current repository path
            var solutions = VsHelper.GetSolutions(repositoryRoot, fileFinder).ToList();

            if (!solutions.Any())
            {
                return ResolveProject(repositoryRoot,
                                      settings,
                                      fileFinder,
                                      searchOption: SearchOption.AllDirectories);
            }

            // More than one solution is ambiguous
            if (solutions.Count > 1)
            {
                // TODO: Show relative paths in error messages
                ThrowAmbiguousSolutionsError(solutions);
            }

            // We have a solution
            VsSolution solution = solutions[0];

            // We need to determine what project to deploy so get a list of all web projects and
            // figure out with some heuristic, which one to deploy.

            // TODO: Pick only 1 and throw if there's more than one
            VsSolutionProject project = solution.Projects.Where(p => p.IsWap || p.IsWebSite || p.IsAspNetCore).FirstOrDefault();

            if (project == null)
            {
                // Try executable type project
                project = solution.Projects.Where(p => p.IsExecutable).FirstOrDefault();
                if (project != null)
                {
                    return new DotNetConsoleBuilder(_environment,
                                              settings,
                                              _propertyProvider,
                                              repositoryRoot,
                                              project.AbsolutePath,
                                              solution.Path);
                }

                logger.Log(Resources.Log_NoDeployableProjects, solution.Path);

                return ResolveNonAspProject(repositoryRoot, null, settings);
            }

            if (project.IsWap)
            {
                return new WapBuilder(_environment,
                                      settings,
                                      _propertyProvider,
                                      repositoryRoot,
                                      project.AbsolutePath,
                                      solution.Path);
            }

            if (project.IsAspNetCore)
            {
                return new AspNetCoreBuilder(_environment,
                                      settings,
                                      _propertyProvider,
//.........这里部分代码省略.........
开发者ID:projectkudu,项目名称:kudu,代码行数:101,代码来源:SiteBuilderFactory.cs

示例6: GetOutputPath

        private static string GetOutputPath(IEnvironment environment, IDeploymentSettingsManager perDeploymentSettings)
        {
            string targetPath = perDeploymentSettings.GetValue(SettingsKeys.TargetPath);

            if (!String.IsNullOrEmpty(targetPath))
            {
                targetPath = targetPath.Trim('\\', '/');
                return Path.GetFullPath(Path.Combine(environment.WebRootPath, targetPath));
            }

            return environment.WebRootPath;
        }
开发者ID:nul800sebastiaan,项目名称:kudu,代码行数:12,代码来源:DeploymentManager.cs


注:本文中的IDeploymentSettingsManager.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。