本文整理汇总了C#中RuleSet.WriteToFile方法的典型用法代码示例。如果您正苦于以下问题:C# RuleSet.WriteToFile方法的具体用法?C# RuleSet.WriteToFile怎么用?C# RuleSet.WriteToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleSet
的用法示例。
在下文中一共展示了RuleSet.WriteToFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteRuleSetFile
public void WriteRuleSetFile(RuleSet ruleSet, string ruleSetPath)
{
if (ruleSet == null)
{
throw new ArgumentNullException(nameof(ruleSet));
}
if (string.IsNullOrWhiteSpace(ruleSetPath))
{
throw new ArgumentNullException(nameof(ruleSetPath));
}
ruleSet.WriteToFile(ruleSetPath);
}
示例2: UpdateDownloadedSonarQubeQualityProfile
private void UpdateDownloadedSonarQubeQualityProfile(RuleSet ruleSet, QualityProfile qualityProfile)
{
ruleSet.NonLocalizedDisplayName = string.Format(Strings.SonarQubeRuleSetNameFormat, this.project.Name, qualityProfile.Name);
var ruleSetDescriptionBuilder = new StringBuilder();
ruleSetDescriptionBuilder.AppendLine(ruleSet.Description);
ruleSetDescriptionBuilder.AppendFormat(Strings.SonarQubeQualityProfilePageUrlFormat, this.connectionInformation.ServerUri, qualityProfile.Key);
ruleSet.NonLocalizedDescription = ruleSetDescriptionBuilder.ToString();
ruleSet.WriteToFile(ruleSet.FilePath);
}
示例3: RuleSetToXml
public static string RuleSetToXml(RuleSet ruleSet)
{
string tempFilePath = Path.GetTempFileName();
ruleSet.WriteToFile(tempFilePath);
return File.ReadAllText(tempFilePath);
}
示例4: VerifyFixedRuleSetIsNotPersisted
private void VerifyFixedRuleSetIsNotPersisted(RuleSet solutionRuleSet, RuleSet projectRuleSet, RuleSet fixedRuleSet)
{
Assert.AreEqual(projectRuleSet.FilePath, fixedRuleSet.FilePath);
// Verify that not persisted
AssertConflictsExpected(solutionRuleSet.FilePath, projectRuleSet.FilePath, "File was not expected to be persisted, so conflicts should remain as they were");
// Write the file and re-check for conflicts
fixedRuleSet.WriteToFile(fixedRuleSet.FilePath);
AssertNoConflictsExpected(solutionRuleSet.FilePath, projectRuleSet.FilePath, "Conflicts were fixed and persisted");
}