From c2567535b5237e1d86ba20c4dea25661394dfc3d Mon Sep 17 00:00:00 2001 From: Somebody Date: Sat, 17 Jun 2023 15:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.config | 6 + App.xaml | 69 ++++++ App.xaml.cs | 29 +++ MainWindow.xaml | 105 ++++++++++ MainWindow.xaml.cs | 324 +++++++++++++++++++++++++++++ MinecraftServerDownloader.csproj | 103 +++++++++ MinecraftServerDownloader.sln | 25 +++ Modules/ModNetwork.cs | 24 +++ Modules/MultiThreadedDownloader.cs | 196 +++++++++++++++++ Properties/AssemblyInfo.cs | 55 +++++ Properties/Resources.Designer.cs | 71 +++++++ Properties/Resources.resx | 117 +++++++++++ Properties/Settings.Designer.cs | 30 +++ Properties/Settings.settings | 7 + packages.config | 4 + 15 files changed, 1165 insertions(+) create mode 100644 App.config create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 MinecraftServerDownloader.csproj create mode 100644 MinecraftServerDownloader.sln create mode 100644 Modules/ModNetwork.cs create mode 100644 Modules/MultiThreadedDownloader.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Resources.Designer.cs create mode 100644 Properties/Resources.resx create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings create mode 100644 packages.config diff --git a/App.config b/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..76aac41 --- /dev/null +++ b/App.xaml @@ -0,0 +1,69 @@ + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..6ea5ef3 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace MinecraftServerDownloader +{ + public partial class App : System.Windows.Application + { + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + // 订阅 DispatcherUnhandledException 事件 + Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; + } + + private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) + { + // 处理异常 + Exception exception = e.Exception; + // 进行异常处理逻辑,如记录异常信息、显示错误消息等 + + // 标记为已处理,以防止应用程序崩溃 + e.Handled = true; + } + } +} diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..fc7dd60 --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +