Esempio n. 1
0
 public DiagnosticDescriptor Create(
     string id,
     string title,
     string messageFormat,
     string category,
     DiagnosticSeverity defaultSeverity,
     bool isEnabledByDefault,
     string description = null,
     string helpLinkUri = null,
     params string[] customTags)
 {
     return(new DiagnosticDescriptor(
                id: id,
                title: title,
                messageFormat: messageFormat,
                category: category,
                defaultSeverity: Rules.GetDiagnosticSeverityOrDefault(id, defaultSeverity),
                isEnabledByDefault: Rules.IsDiagnosticEnabledOrDefault(id, isEnabledByDefault),
                description: description,
                helpLinkUri: DiagnosticDescriptorUtility.GetHelpLinkUri(helpLinkUri),
                customTags: customTags));
 }
Esempio n. 2
0
        public static DiagnosticDescriptor Create(
            string id,
            string title,
            string messageFormat,
            string category,
            DiagnosticSeverity defaultSeverity,
            bool isEnabledByDefault,
            string description = null,
            string helpLinkUri = null,
            params string[] customTags)
        {
            isEnabledByDefault = CodeAnalysisConfig.Instance.IsDiagnosticEnabledByDefault(id, category, isEnabledByDefault);

            return(new DiagnosticDescriptor(
                       id: id,
                       title: title,
                       messageFormat: messageFormat,
                       category: category,
                       defaultSeverity: CodeAnalysisConfig.Instance.GetDiagnosticSeverity(id, category, isEnabledByDefault) ?? defaultSeverity,
                       isEnabledByDefault: isEnabledByDefault,
                       description: description,
                       helpLinkUri: DiagnosticDescriptorUtility.GetHelpLinkUri(helpLinkUri),
                       customTags: customTags));
        }