diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx
index 1b0e5e1330..2753390aa8 100644
--- a/data/resources/StringResources.resx
+++ b/data/resources/StringResources.resx
@@ -6381,15 +6381,12 @@ Removed the end part of the original message ", reason '${Message}'" since this
Delete all web references
Title of the dialog box when the user tries to remove all web references.
-
- Open .NET Reflector
-
-
- Reflector could not be found at the specified location, or SharpDevelop does not have sufficient rights to access it.
-
The path to Reflector has not been set yet.
+
+ Change Reflector path.
+
Failed to connect to Reflector.
@@ -6402,6 +6399,17 @@ Removed the end part of the original message ", reason '${Message}'" since this
Set path to Reflector
+
+ Reflector was found in the following directory:
+
+
+ Reflector
+ Title of Reflector path choosing groupbox
+
+
+ Select Reflector path
+ Button to select the Reflector path
+
Assemblies (*.dll)|*.dll
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.addin b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.addin
index b401f093ed..7a631e8e15 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.addin
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.addin
@@ -30,5 +30,10 @@
-
+
+
+
+
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.csproj b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.csproj
index ecd93b97b7..14858554fc 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.csproj
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/ReflectorAddIn.csproj
@@ -40,12 +40,18 @@
+
+
3.5
+
+ 4.0
+
+
@@ -53,22 +59,25 @@
+
+ ChangeReflectorPath.xaml
+ Code
+
-
-
- SetReflectorPathDialog.cs
-
+
+ SetReflectorPath.xaml
+ Code
+
Always
-
- SetReflectorPathDialog.cs
-
+
+
{2748AD25-9C63-4E12-877B-4DCE96FBED54}
ICSharpCode.SharpDevelop
@@ -79,10 +88,22 @@
ICSharpCode.Core
False
+
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}
+ ICSharpCode.Core.Presentation
+
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}
ICSharpCode.SharpDevelop.Dom
False
+
+ {8035765F-D51F-4A0C-A746-2FD100E19419}
+ ICSharpCode.SharpDevelop.Widgets
+
+
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml
new file mode 100644
index 0000000000..8399ffba9e
--- /dev/null
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml.cs
new file mode 100644
index 0000000000..a79242ee6a
--- /dev/null
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/OptionPanels/ChangeReflectorPath.xaml.cs
@@ -0,0 +1,35 @@
+
+using System;
+using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
+
+namespace ReflectorAddIn.OptionPanels
+{
+ public partial class ChangeReflectorPath : OptionPanel
+ {
+ public ChangeReflectorPath()
+ {
+ InitializeComponent();
+
+ Loaded += delegate { ShowStatus(); };
+ }
+
+ void ShowStatus()
+ {
+ string path = PropertyService.Get(ReflectorSetupHelper.ReflectorExePathPropertyName);
+
+ if (string.IsNullOrEmpty(path)) {
+ StatusLabel.Text = StringParser.Parse("${res:ReflectorAddIn.ReflectorPathNotSet}");
+ } else {
+ StatusLabel.Text = StringParser.Parse("${res:ReflectorAddIn.IdeOptions.ReflectorFoundInPath}")
+ + Environment.NewLine + path;
+ }
+ }
+
+ void FindReflectorPathClick(object sender, EventArgs e)
+ {
+ ReflectorSetupHelper.OpenReflectorExeFullPathInteractiver();
+ ShowStatus();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorController.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorController.cs
index 540621a23f..07146d2588 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorController.cs
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorController.cs
@@ -1,15 +1,13 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-using ICSharpCode.SharpDevelop.Dom;
using System;
using System.Diagnostics;
using System.IO;
-using System.Runtime.Remoting;
-using System.Text;
using System.Threading;
-using System.Windows.Forms;
+
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
namespace ReflectorAddIn
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorSetupHelper.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorSetupHelper.cs
index c5ed1f56c7..37d6a0a610 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorSetupHelper.cs
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/ReflectorSetupHelper.cs
@@ -1,12 +1,13 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-using ICSharpCode.SharpDevelop.Gui;
using System;
using System.IO;
using System.Text.RegularExpressions;
-using System.Windows.Forms;
+
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
+using ReflectorAddIn.Windows;
namespace ReflectorAddIn
{
@@ -31,19 +32,29 @@ namespace ReflectorAddIn
}
if (askReason != null) {
- using(SetReflectorPathDialog dialog = new SetReflectorPathDialog(path, askReason)) {
-
- if (dialog.ShowDialog(WorkbenchSingleton.MainWin32Window) != DialogResult.OK || !File.Exists(dialog.SelectedFile)) {
- return null;
- }
-
- path = dialog.SelectedFile;
- PropertyService.Set(ReflectorExePathPropertyName, path);
-
- }
+ SetReflectorPath dialog = new SetReflectorPath(path, askReason);
+ bool? result = dialog.ShowDialog();
+ if (!result.HasValue || !result.Value || !File.Exists(dialog.SelectedFile))
+ return null;
+
+ path = dialog.SelectedFile;
+ PropertyService.Set(ReflectorExePathPropertyName, path);
}
return path;
}
+
+ internal static void OpenReflectorExeFullPathInteractiver() {
+ string path = PropertyService.Get(ReflectorExePathPropertyName);
+ string askReason = ResourceService.GetString("ReflectorAddIn.ReflectorChangePath");
+
+ SetReflectorPath dialog = new SetReflectorPath(path, askReason);
+
+ bool? result = dialog.ShowDialog();
+ if (!result.HasValue || !result.Value || !File.Exists(dialog.SelectedFile))
+ return;
+
+ PropertyService.Set(ReflectorExePathPropertyName, dialog.SelectedFile);
+ }
}
}
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
index f1b6d17b5a..9d7268db78 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
@@ -2,14 +2,11 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Dom;
-using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.ClassBrowser;
using ICSharpCode.SharpDevelop.Project;
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml
new file mode 100644
index 0000000000..ddf5a7635e
--- /dev/null
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml.cs
new file mode 100644
index 0000000000..4407d5b827
--- /dev/null
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/Windows/SetReflectorPath.xaml.cs
@@ -0,0 +1,79 @@
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+
+using ICSharpCode.Core;
+using Microsoft.Win32;
+
+namespace ReflectorAddIn.Windows
+{
+ public partial class SetReflectorPath : Window
+ {
+ public SetReflectorPath(string oldPath, string reason)
+ {
+ InitializeComponent();
+
+ this.Title = ResourceService.GetString("ReflectorAddIn.SetReflectorPathDialogTitle");
+
+ this.txtReason.Text = reason;
+ if (!String.IsNullOrEmpty(oldPath)) {
+ this.slePath.Text = oldPath;
+ }
+ }
+
+ public string SelectedFile {
+ get {
+ return slePath.Text;
+ }
+ }
+
+ void OpenReflectorPageButton_Click(object sender, RoutedEventArgs e)
+ {
+ try {
+ using(System.Diagnostics.Process.Start("http://reflector.red-gate.com/Download.aspx")) {
+ }
+ } catch (Exception ex) {
+ MessageService.ShowError(ex.Message);
+ }
+ }
+
+ void OkButton_Click(object sender, RoutedEventArgs e)
+ {
+ this.DialogResult = true;
+ Close();
+ }
+
+ void CancelButton_Click(object sender, RoutedEventArgs e)
+ {
+ this.DialogResult = false;
+ Close();
+ }
+
+ void BrowseButton_Click(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog dialog = new OpenFileDialog();
+
+ dialog.Title = this.Title;
+ dialog.DefaultExt = "exe";
+ dialog.RestoreDirectory = true;
+ dialog.Filter = "Reflector.exe|Reflector.exe";
+
+ if (!String.IsNullOrEmpty(this.slePath.Text)) {
+ dialog.FileName = this.slePath.Text;
+ }
+
+ bool? result = dialog.ShowDialog(this);
+
+ if (result.HasValue && result.Value) {
+ this.slePath.Text = dialog.FileName;
+ }
+ }
+ }
+}
\ No newline at end of file