v2rayN/v2rayN.backup/v2rayN/Forms/BaseForm.cs
2022-03-05 23:04:17 +08:00

40 lines
951 B
C#

using System;
using System.Windows.Forms;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class BaseForm : Form
{
protected static Config config;
protected static System.Drawing.Icon icon;
public BaseForm()
{
InitializeComponent();
LoadCustomIcon();
}
private void LoadCustomIcon()
{
try
{
if (icon == null)
{
string file = Utils.GetPath(Global.CustomIconName);
if (!System.IO.File.Exists(file))
{
return;
}
icon = new System.Drawing.Icon(file);
}
this.Icon = icon;
}
catch (Exception e)
{
Utils.SaveLog($"Loading custom icon failed: {e.Message}");
}
}
}
}