本文整理汇总了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);
}
示例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);
}
}