-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFormNewVersionAvailable.vb
More file actions
60 lines (45 loc) · 2.29 KB
/
FormNewVersionAvailable.vb
File metadata and controls
60 lines (45 loc) · 2.29 KB
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
Option Strict On
Public Class FormNewVersionAvailable
Public Sub New(CurrentVersion As String, NewVersion As String)
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Dim s = String.Format("Version {0} is available. You have version {1}.", NewVersion, CurrentVersion)
LabelNewVersionAvailable.Text = s
End Sub
Private Sub FormNewVersionAvailable_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim LLList As List(Of LinkLabel)
LLList = {LinkLabelReleaseNotes, LinkLabelInstallationInstructions, LinkLabelDownloadPage}.ToList
Dim URLList As New List(Of String)
URLList.Add("https://github.com/rmcanany/SolidEdgeStorekeeper/blob/master/release_notes.md")
URLList.Add("https://github.com/rmcanany/SolidEdgeStorekeeper#installation")
URLList.Add("https://github.com/rmcanany/SolidEdgeStorekeeper/releases")
Dim StartIdx = 0
Dim EndIdx As Integer
For i = 0 To LLList.Count - 1
EndIdx = Len(LLList(i).Text)
LLList(i).Links.Add(StartIdx, EndIdx, URLList(i))
Next
End Sub
Private Sub LinkLabelReleaseNotes_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabelReleaseNotes.LinkClicked
Dim Info = New ProcessStartInfo()
Info.FileName = e.Link.LinkData.ToString
Info.UseShellExecute = True
Process.Start(Info)
End Sub
Private Sub LinkLabelInstallationInstructions_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabelInstallationInstructions.LinkClicked
Dim Info = New ProcessStartInfo()
Info.FileName = e.Link.LinkData.ToString
Info.UseShellExecute = True
Process.Start(Info)
End Sub
Private Sub LinkLabelDownloadPage_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabelDownloadPage.LinkClicked
Dim Info = New ProcessStartInfo()
Info.FileName = e.Link.LinkData.ToString
Info.UseShellExecute = True
Process.Start(Info)
End Sub
Private Sub ButtonOK_Click(sender As Object, e As EventArgs) Handles ButtonOK.Click
Me.DialogResult = DialogResult.OK
End Sub
End Class