Refactoring Settings.cs

This commit is contained in:
BruceChen 2022-10-05 15:02:30 +08:00
parent f16b1c118b
commit 16c1d1fd77
59 changed files with 3425 additions and 2180 deletions

View file

@ -67,6 +67,16 @@ namespace MinecraftClient.WinAPI
imageStream.Dispose();
httpWebRequest.Dispose();
}
catch (AggregateException ae)
{
foreach (var ex in ae.InnerExceptions)
{
if (ex is HttpRequestException) //Skin not found? Reset to default icon
RevertToMCCIcon();
else
throw ex;
}
}
catch (HttpRequestException) //Skin not found? Reset to default icon
{
RevertToMCCIcon();

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
namespace MinecraftClient.WinAPI
{
@ -79,9 +80,10 @@ namespace MinecraftClient.WinAPI
}
[DllImport("Kernel32")]
private static extern bool SetConsoleCtrlHandler(ConsoleCtrlHandler handler, bool add);
private delegate bool ConsoleCtrlHandler(CtrlType sig);
private static readonly ConsoleCtrlHandler? _handler;
private static extern bool SetConsoleCtrlHandler(EventHandler handler, bool add);
private delegate bool EventHandler(CtrlType sig);
static EventHandler? _handler;
enum CtrlType
{