Browse Source

Extract "Search MSDN" and search through the current language

pull/1299/head
MysticBoy 6 years ago
parent
commit
b79fa7e018
  1. 11
      ILSpy/Properties/Resources.Designer.cs
  2. 3
      ILSpy/Properties/Resources.resx
  3. 3
      ILSpy/Properties/Resources.zh-Hans.resx
  4. 10
      ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs

11
ILSpy/Properties/Resources.Designer.cs generated

@ -1476,7 +1476,16 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1476,7 +1476,16 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// Looks up a localized string similar to Search.
/// 查找类似 Search MSDN... 的本地化字符串。
/// </summary>
public static string SearchMSDN {
get {
return ResourceManager.GetString("SearchMSDN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search.
/// </summary>
public static string SearchPane_Search {
get {

3
ILSpy/Properties/Resources.resx

@ -723,4 +723,7 @@ @@ -723,4 +723,7 @@
<data name="DecompilerSettings.ApplyWindowsRuntimeProjectionsOnLoadedAssemblies" xml:space="preserve">
<value>Apply Windows Runtime projections on loaded assemblies</value>
</data>
<data name="SearchMSDN" xml:space="preserve">
<value>Search MSDN...</value>
</data>
</root>

3
ILSpy/Properties/Resources.zh-Hans.resx

@ -726,4 +726,7 @@ @@ -726,4 +726,7 @@
<data name="DecompilerSettings.ApplyWindowsRuntimeProjectionsOnLoadedAssemblies" xml:space="preserve">
<value>在已加载的程序集上应用 Windows 运行时投影</value>
</data>
<data name="SearchMSDN" xml:space="preserve">
<value>搜索MSDN...</value>
</data>
</root>

10
ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs

@ -18,13 +18,15 @@ @@ -18,13 +18,15 @@
using System.Linq;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.Properties;
using System.Threading;
namespace ICSharpCode.ILSpy.TreeNodes
{
[ExportContextMenuEntry(Header = "Search MSDN...", Icon = "images/SearchMsdn.png", Order = 9999)]
[ExportContextMenuEntry(Header = nameof(Resources.SearchMSDN), Icon = "images/SearchMsdn.png", Order = 9999)]
internal sealed class SearchMsdnContextMenuEntry : IContextMenuEntry
{
private static string msdnAddress = "http://msdn.microsoft.com/en-us/library/{0}";
private static string msdnAddress = "http://msdn.microsoft.com/{1}/library/{0}";
public bool IsVisible(TextViewContext context)
{
@ -98,7 +100,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -98,7 +100,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
var namespaceNode = node as NamespaceTreeNode;
if (namespaceNode != null)
address = string.Format(msdnAddress, namespaceNode.Name);
address = string.Format(msdnAddress, namespaceNode.Name, Thread.CurrentThread.CurrentUICulture.Name);
if (node is IMemberTreeNode memberNode) {
var member = memberNode.Member;
@ -109,7 +111,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -109,7 +111,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
else
memberName = string.Format("{0}.{1}", member.DeclaringType.FullName, member.Name);
address = string.Format(msdnAddress, memberName);
address = string.Format(msdnAddress, memberName, Thread.CurrentThread.CurrentUICulture.Name);
}
address = address.ToLower();

Loading…
Cancel
Save