本文整理汇总了C#中Diagnostic.GetBingHelpMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Diagnostic.GetBingHelpMessage方法的具体用法?C# Diagnostic.GetBingHelpMessage怎么用?C# Diagnostic.GetBingHelpMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Diagnostic
的用法示例。
在下文中一共展示了Diagnostic.GetBingHelpMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHelpLink
private static Uri GetHelpLink(Diagnostic diagnostic, string language, string projectType, out string helpLinkToolTipText)
{
var isBing = false;
helpLinkToolTipText = string.Empty;
Uri helpLink;
if (!BrowserHelper.TryGetUri(diagnostic.Descriptor.HelpLinkUri, out helpLink))
{
// We use the ENU version of the message for bing search.
helpLink = BrowserHelper.CreateBingQueryUri(diagnostic.Id, diagnostic.GetBingHelpMessage(), language, projectType);
isBing = true;
}
// We make sure not to use Uri.AbsoluteUri for the url displayed in the tooltip so that the url displayed in the tooltip stays human readable.
if (helpLink != null)
{
helpLinkToolTipText =
string.Format(ServicesVSResources.DiagnosticIdHyperlinkTooltipText, diagnostic.Id,
isBing ? ServicesVSResources.FromBing : null, Environment.NewLine, helpLink);
}
return helpLink;
}
示例2: Create
public static DiagnosticData Create(Document document, Diagnostic diagnostic)
{
var location = CreateLocation(document, diagnostic.Location);
var additionalLocations = diagnostic.AdditionalLocations.Count == 0
? (IReadOnlyCollection<DiagnosticDataLocation>)SpecializedCollections.EmptyArray<DiagnosticDataLocation>()
: diagnostic.AdditionalLocations.Where(loc => loc.IsInSource)
.Select(loc => CreateLocation(document.Project.GetDocument(loc.SourceTree), loc))
.WhereNotNull()
.ToReadOnlyCollection();
return new DiagnosticData(
diagnostic.Id,
diagnostic.Descriptor.Category,
diagnostic.GetMessage(CultureInfo.CurrentUICulture),
diagnostic.GetBingHelpMessage(),
diagnostic.Severity,
diagnostic.DefaultSeverity,
diagnostic.Descriptor.IsEnabledByDefault,
diagnostic.WarningLevel,
diagnostic.Descriptor.CustomTags.AsImmutableOrEmpty(),
diagnostic.Properties,
document.Project.Solution.Workspace,
document.Project.Id,
location,
additionalLocations,
title: diagnostic.Descriptor.Title.ToString(CultureInfo.CurrentUICulture),
description: diagnostic.Descriptor.Description.ToString(CultureInfo.CurrentUICulture),
helpLink: diagnostic.Descriptor.HelpLinkUri,
isSuppressed: diagnostic.IsSuppressed);
}