forked from basildane/WakeOnLAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAboutBox.vb
101 lines (80 loc) · 4.14 KB
/
AboutBox.vb
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
' WakeOnLAN - Wake On LAN
' Copyright (C) 2004-2016 Aquila Technology, LLC. <webmaster@aquilatech.com>
'
' This file is part of WakeOnLAN.
'
' WakeOnLAN is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' WakeOnLAN is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with WakeOnLAN. If not, see <http://www.gnu.org/licenses/>.
Imports System.Reflection
Imports System.Linq
Imports AutoUpdaterDotNET
Public NotInheritable Class AboutBox
Private Sub AboutBox1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
LabelProductName.Text = My.Resources.Strings.Title
LabelVersion.Text = String.Format(My.Resources.Strings.Version, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)
LabelCopyright.Text = My.Resources.Strings.Copyright
LabelCulture.Text = Globalization.CultureInfo.CurrentUICulture.NativeName.ToString()
If My.Application.Info.Version.Revision > 0 Then
LabelVersion.Text &= " BETA " & My.Application.Info.Version.Revision
End If
#If DEBUG Then
LabelVersion.Text &= " [DEBUG]"
#End If
ListBox1.Items.Clear()
For Each a As AssemblyName In Assembly.GetExecutingAssembly().GetReferencedAssemblies().ToArray()
ListBox1.Items.Add(String.Format("{0}, {1}: {2}", a.Name, GroupBoxVersion.Text, a.Version))
Next
AutoUpdater.CurrentCulture = Application.CurrentCulture
AutoUpdater.AppCastURL = My.Settings.updateURL
AutoUpdater.versionURL = My.Settings.updateVersions
AddHandler AutoUpdater.UpdateStatus, AddressOf UpdateStatus
AutoUpdater.Start(0)
End Sub
Private Sub pbUpdate_Click(sender As Object, e As EventArgs) Handles pbUpdate.Click
AutoUpdater.force = True
AutoUpdater.Start(0)
End Sub
Private Delegate Sub UpdateStatusHandler(sender As Object, e As AutoUpdateEventArgs)
Private Sub UpdateStatus(sender As Object, e As AutoUpdateEventArgs)
If (InvokeRequired) Then
BeginInvoke(New UpdateStatusHandler(AddressOf UpdateStatus), New Object() {sender, e})
Return
End If
Select Case (e.Status)
Case AutoUpdateEventArgs.StatusCodes.checking
pbUpdate.Image = My.Resources.system_software_update
Case AutoUpdateEventArgs.StatusCodes.error
pbUpdate.Image = My.Resources.error2
RemoveHandler AutoUpdater.UpdateStatus, AddressOf UpdateStatus
Case AutoUpdateEventArgs.StatusCodes.updateAvailable
pbUpdate.Image = My.Resources.software_update_available
RemoveHandler AutoUpdater.UpdateStatus, AddressOf UpdateStatus
Case Else
pbUpdate.Image = My.Resources.emblem_ok
RemoveHandler AutoUpdater.UpdateStatus, AddressOf UpdateStatus
End Select
lAutomaticUpdate.Text = e.Text
End Sub
Private Sub OKButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OKButton.Click
Dispose()
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Process.Start(LinkLabel1.Text)
End Sub
Private Sub LinkLabel2_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
Process.Start(LinkLabel2.Text)
End Sub
Private Sub bDonate_Click(sender As Object, e As EventArgs) Handles bDonate.Click
Process.Start(My.Settings.donate)
End Sub
End Class