-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormAbout.cs
61 lines (55 loc) · 1.8 KB
/
FormAbout.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Drawing.Drawing2D;
using System.Net.NetworkInformation;
namespace NUBTool
{
public partial class FormAbout : Form
{
public FormAbout()
{
InitializeComponent();
}
private void FormAbout_Load(object sender, EventArgs e)
{
if (NetworkInterface.GetIsNetworkAvailable())
{
pictureBox_Icon.ImageLocation = "https://avatars.githubusercontent.com/u/59692068?v=4";
}
else
{
pictureBox_Icon.Image = null;
}
}
private void linkLabel_github_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Common.Utils.OpenURI("https://github.com/XyLe-GBP");
}
private void linkLabel_web_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Common.Utils.OpenURI("https://xyle-official.com");
}
private void button_OK_Click(object sender, EventArgs e)
{
Close();
}
private void pictureBox_Icon_Paint(object sender, PaintEventArgs e)
{
try
{
base.OnPaint(e);
Bitmap canvas = new Bitmap(pictureBox_Icon.Width, pictureBox_Icon.Height);
Graphics g = Graphics.FromImage(canvas);
GraphicsPath gp = new();
gp.AddEllipse(g.VisibleClipBounds);
Region rgn = new(gp);
pictureBox_Icon.Region = rgn;
return;
}
catch (Exception ex)
{
MessageBox.Show(string.Format("An error has occurred.\n{0}", ex.ToString()), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
}
}
}