コード例 #1
0
 /// <summary>
 /// Creates a new DiagnosticDescriptor instance copying all the properties from the original, overriding the
 /// Severity.
 /// </summary>
 /// <param name="descriptor">DiagnosticDescriptor instance to copy.</param>
 /// <param name="severity">The new value of the Severity property.</param>
 /// <returns>A new DiagnosticDescriptor instance with overridden value of the Severity property.</returns>
 public static DiagnosticDescriptor WithSeverity(this DiagnosticDescriptor descriptor, Severity severity)
 {
     return(new DiagnosticDescriptor(
                descriptor.Id,
                (string)descriptor.Title,
                (string)descriptor.MessageFormat,
                descriptor.Category,
                severity.ToDiagnosticSeverity(),
                descriptor.IsEnabledByDefault,
                (string)descriptor.Description,
                descriptor.HelpLinkUri,
                descriptor.CustomTags.ToArray()));
 }
コード例 #2
0
 public static DiagnosticSeverity ToDiagnosticSeverity(this Severity severity)
 {
     return(severity.ToDiagnosticSeverity(IdeVisibility.Visible));
 }
コード例 #3
0
 public static DiagnosticDescriptor CreateDiagnosticDescriptor(string diagnosticId, string messageFormat)
 {
     return(new DiagnosticDescriptor(diagnosticId, Description, messageFormat, Category,
                                     RuleSeverity.ToDiagnosticSeverity(), IsActivatedByDefault,
                                     helpLinkUri: "http://nemo.sonarqube.org/coding_rules#rule_key=csharpsquid%3ACommentRegularExpression"));
 }
コード例 #4
0
 public static DiagnosticDescriptor CreateDiagnosticDescriptor(string diagnosticId, string messageFormat)
 {
     return(new DiagnosticDescriptor(diagnosticId, Title, messageFormat, Category,
                                     RuleSeverity.ToDiagnosticSeverity(), IsActivatedByDefault));
 }