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


C# Solution.GetName方法代码示例

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


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

示例1: Configure

        /// <summary>
        /// Creates a default readme.md document for the solution
        /// </summary>
        /// <param name="solution">the solution object</param>
        /// <param name="docsFolderName">the solution folder to add the readme to</param>
        public static void Configure(Solution solution, string docsFolderName)
        {
            // create a default readme in the solution root
            var readmePath = Path.Combine(solution.GetDirectory(), ReadmeFileName);
            var readmeTemplate = string.Format(RS.readme, solution.GetName());
            if (!File.Exists(readmePath))
            {
                File.WriteAllText(readmePath, readmeTemplate);
            }

            // add as link to docs folder
            var readmeRelatiePath = readmePath.GetRelativePath(docsFolderName);
            var docsProject = solution.GetProject(docsFolderName);
            docsProject?.AddLinkItem("None", readmeRelatiePath, ReadmeFileName);
        }
开发者ID:matt40k,项目名称:VSAutomate,代码行数:20,代码来源:Readme.cs

示例2: Configure

        /// <summary>
        /// Sets up a globalassemblyinfo file in the solution root and links this to all solution projects
        /// </summary>
        /// <param name="solution">The solution object</param>
        /// <param name="companyName">The company name to add in the GlobalAssemblyInfo</param>
        public static void Configure(Solution solution, string companyName)
        {
            // Adds a globalassemblyinfo file to a solution directory and links it to all projects
            var globalFilePath = Path.Combine(solution.GetDirectory(), GlobalFileName);

            if (!File.Exists(globalFilePath))
            {
                var fileText = RS.GlobalAssemblyInfo;
                var formattedFileText = string.Format(fileText, solution.GetName(), "[Enter description]", companyName, DateTime.Today.Year, CultureInfo.CurrentCulture);
                File.WriteAllText(globalFilePath, formattedFileText);
            }

            foreach (var project in solution.GetProjects())
            {
                project.AddLinkItem("compile", project.GetDirectory().GetRelativePath(globalFilePath), "Properties\\" + GlobalFileName);
            }
        }
开发者ID:matt40k,项目名称:VSAutomate,代码行数:22,代码来源:GlobalAssemblyInfo.cs


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