Skip to content

Commit

Permalink
Remove part System.Reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Dec 8, 2024
1 parent e7f04f5 commit 53a99e3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions v2rayN/ServiceLib/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class Global
public const string SpeedUnit = "";
public const int MinFontSize = 10;
public const string RebootAs = "rebootas";
public const string AvaAssets = "avares://v2rayN/Assets/";

public static readonly List<string> IEProxyProtocols = new() {
"{ip}:{http_port}",
Expand Down
3 changes: 1 addition & 2 deletions v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using Avalonia;
using Avalonia.Media;
using System.Reflection;

namespace v2rayN.Desktop.Common
{
public static class AppBuilderExtension
{
public static AppBuilder WithFontByDefault(this AppBuilder appBuilder)
{
var uri = $"avares://{Assembly.GetExecutingAssembly().GetName().Name}/Assets/Fonts#Noto Sans SC";
var uri = Path.Combine(Global.AvaAssets, "Fonts#Noto Sans SC");
return appBuilder.With(new FontManagerOptions()
{
DefaultFamilyName = uri,
Expand Down
3 changes: 1 addition & 2 deletions v2rayN/v2rayN.Desktop/Common/AvaUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Avalonia.Input;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using System.Reflection;

namespace v2rayN.Desktop.Common
{
Expand Down Expand Up @@ -41,7 +40,7 @@ public static async Task SetClipboardData(Visual? visual, string strData)
public static WindowIcon GetAppIcon(ESysProxyType sysProxyType)
{
var index = (int)sysProxyType + 1;
var uri = new Uri($"avares://{Assembly.GetExecutingAssembly().GetName().Name}/Assets/NotifyIcon{index}.ico");
var uri = new Uri(Path.Combine(Global.AvaAssets, $"NotifyIcon{index}.ico"));
using var bitmap = new Bitmap(AssetLoader.Open(uri));
return new(bitmap);
}
Expand Down
1 change: 0 additions & 1 deletion v2rayN/v2rayN/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public partial class App : Application

public App()
{
// Locator.CurrentMutable.RegisterViewsForViewModels(Assembly.GetCallingAssembly());
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
Expand Down

0 comments on commit 53a99e3

Please sign in to comment.