| 1 | using System; |
| 2 | using System.Collections.Generic; |
| 3 | using System.Diagnostics; |
| 4 | using System.IO; |
| 5 | using System.Linq; |
| 6 | using System.Text; |
| 7 | using System.Threading.Tasks; |
| 8 | using System.Windows; |
| 9 | using System.Windows.Controls; |
| 10 | using System.Windows.Data; |
| 11 | using System.Windows.Documents; |
| 12 | using System.Windows.Input; |
| 13 | using System.Windows.Media; |
| 14 | using System.Windows.Media.Imaging; |
| 15 | using System.Windows.Navigation; |
| 16 | using System.Windows.Shapes; |
| 17 | |
| 18 | namespace TaiBug |
| 19 | { |
| 20 | ///<summary> |
| 21 | /// |
| 22 | ///</summary> |
| 23 | public partial class MainWindow : Window |
| 24 | { |
| 25 | public MainWindow() |
| 26 | { |
| 27 | InitializeComponent(); |
| 28 | } |
| 29 | |
| 30 | private void LogHyperlinkClick(object sender, RoutedEventArgs e) |
| 31 | { |
| 32 | string loggerName = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, |
| 33 | "Log", DateTime.Now.ToString("yyyy-MM-dd") + ".log"); |
| 34 | if (File.Exists(loggerName)) |
| 35 | { |
| 36 | System.Diagnostics.Process.Start("explorer.exe", "/select, " + loggerName); |
| 37 | } |
| 38 | } |
| 39 | private void IssuesHyperlinkClick(object sender, RoutedEventArgs e) |
| 40 | { |
| 41 | Process.Start(new ProcessStartInfo("https://github.com/Planshit/Tai/issues/new")); |
| 42 | } |
| 43 | private void EmailHyperlinkClick(object sender, RoutedEventArgs e) |
| 44 | { |
| 45 | Clipboard.SetText("[email protected]"); |
| 46 | MessageBox.Show("邮箱已复制"); |
| 47 | } |
| 48 | private void Restart(object sender, RoutedEventArgs e) |
| 49 | { |
| 50 | string taiPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, |
| 51 | "Tai.exe"); |
| 52 | if (File.Exists(taiPath)) |
| 53 | { |
| 54 | Process.Start(taiPath); |
| 55 | } |
| 56 | else |
| 57 | { |
| 58 | MessageBox.Show("Tai.exe 似乎已被删除", "重启失败提示", MessageBoxButton.OK, MessageBoxImage.Error); |
| 59 | Process.Start(new ProcessStartInfo("https://github.com/Planshit/Tai")); |
| 60 | } |
| 61 | Close(); |
| 62 | } |
| 63 | } |
| 64 | } |