跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

MainWindow.xaml.cs

64 行 · 2.0 KB历史下载
1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.IO;
5using System.Linq;
6using System.Text;
7using System.Threading.Tasks;
8using System.Windows;
9using System.Windows.Controls;
10using System.Windows.Data;
11using System.Windows.Documents;
12using System.Windows.Input;
13using System.Windows.Media;
14using System.Windows.Media.Imaging;
15using System.Windows.Navigation;
16using System.Windows.Shapes;
17
18namespace TaiBug
19{
20 /// <summary>
21 /// MainWindow.xaml 的交互逻辑
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}