This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
/
SetReflectorPath.xaml.cs
82 lines (69 loc) · 1.8 KB
/
SetReflectorPath.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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");
if (reason != null)
this.txtReason.Text = reason;
else
this.txtReason.Visibility = Visibility.Collapsed;
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;
}
}
}
}