diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index 0966cbb2c..227bf9a8a 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -167,7 +167,7 @@ namespace ICSharpCode.ILSpy button.Content = "Download"; button.Cursor = Cursors.Arrow; button.Click += delegate { - Process.Start(availableVersion.DownloadUrl); + MainWindow.OpenLink(availableVersion.DownloadUrl); }; stackPanel.Children.Add(button); } diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 504c8cc58..5b2cfde45 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -418,7 +418,7 @@ namespace ICSharpCode.ILSpy void downloadOrCheckUpdateButtonClick(object sender, RoutedEventArgs e) { if (updateAvailableDownloadUrl != null) { - Process.Start(updateAvailableDownloadUrl); + MainWindow.OpenLink(updateAvailableDownloadUrl); } else { updatePanel.Visibility = Visibility.Collapsed; AboutPage.CheckForUpdatesAsync(spySettings ?? ILSpySettings.Load()) @@ -654,16 +654,21 @@ namespace ICSharpCode.ILSpy SelectNode(treeNode); } else if (reference is Mono.Cecil.Cil.OpCode) { string link = "http://msdn.microsoft.com/library/system.reflection.emit.opcodes." + ((Mono.Cecil.Cil.OpCode)reference).Code.ToString().ToLowerInvariant() + ".aspx"; - try { - Process.Start(link); + OpenLink(link); + } + return decompilationTask; + } + + public static void OpenLink(string link) + { + try { + Process.Start(link); #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body - } catch (Exception) { + } catch (Exception) { #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body - // Process.Start can throw several errors (not all of them documented), - // just ignore all of them. - } + // Process.Start can throw several errors (not all of them documented), + // just ignore all of them. } - return decompilationTask; } #endregion diff --git a/ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs b/ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs index ee6045141..444dd1712 100644 --- a/ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs +++ b/ILSpy/TreeNodes/SearchMsdnContextMenuEntry.cs @@ -106,7 +106,7 @@ namespace ICSharpCode.ILSpy.TreeNodes address = address.ToLower(); if (!string.IsNullOrEmpty(address)) - Process.Start(address); + MainWindow.OpenLink(address); } } } \ No newline at end of file