示例#1
0
        private static DiagnosticDescriptor CreateDescriptor(int errorCode, DiagnosticSeverity defaultSeverity, CommonMessageProvider messageProvider)
        {
            var id            = messageProvider.GetIdForErrorCode(errorCode);
            var title         = messageProvider.GetTitle(errorCode);
            var description   = messageProvider.GetDescription(errorCode);
            var messageFormat = messageProvider.GetMessageFormat(errorCode);
            var helpLink      = messageProvider.GetHelpLink(errorCode);
            var category      = messageProvider.GetCategory(errorCode);
            var customTags    = GetCustomTags(defaultSeverity);

            return(new DiagnosticDescriptor(id, title, messageFormat, category, defaultSeverity,
                                            isEnabledByDefault: true, description: description, helpLinkUri: helpLink, customTags: customTags));
        }