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


C# RuleSet.WriteToFile方法代码示例

本文整理汇总了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);
        }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:14,代码来源:RuleSetSerializer.cs

示例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);
        }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:11,代码来源:BindingWorkflow.cs

示例3: RuleSetToXml

 public static string RuleSetToXml(RuleSet ruleSet)
 {
     string tempFilePath = Path.GetTempFileName();
     ruleSet.WriteToFile(tempFilePath);
     return File.ReadAllText(tempFilePath);
 }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:6,代码来源:TestRuleSetHelper.cs

示例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");
        }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:11,代码来源:RuleSetInspectorTests.cs


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