Skip to content

Commit 31fc636

Browse files
committed
Common library Updater changes
- Modified global variables to avoid implicit definitions - Added update controller to global variables - Updated OctoKit NuGet library to latest version - Removing update provider classes and interface in favor of single defined class with multiple event argument classes
1 parent 5ddaf90 commit 31fc636

11 files changed

+236
-244
lines changed

WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb

Lines changed: 0 additions & 33 deletions
This file was deleted.

WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb

Lines changed: 0 additions & 130 deletions
This file was deleted.

WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
' WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
2+
' Copyright (C) 2019-2021 Gawindx (Decaux Nicolas)
3+
'
4+
' This program is free software: you can redistribute it and/or modify it under the terms of the
5+
' GNU General Public License as published by the Free Software Foundation, either version 3 of the
6+
' License, or any later version.
7+
'
8+
' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY
9+
10+
Imports System.ComponentModel
11+
12+
Namespace Updater
13+
''' <summary>
14+
''' Represent important details resulting from a completed async request to check for updates.
15+
''' </summary>
16+
Public Class UpdateCheckCompletedEventArgs
17+
Inherits AsyncCompletedEventArgs
18+
19+
Private ReadOnly _LatestRelease As Octokit.Release
20+
21+
ReadOnly Property LatestRelease As Octokit.Release
22+
Get
23+
Return _LatestRelease
24+
End Get
25+
End Property
26+
27+
Public Sub New(latestRelease As Octokit.Release, Optional [error] As Exception = Nothing,
28+
Optional cancelled As Boolean = False)
29+
30+
MyBase.New([error], cancelled, Nothing)
31+
_LatestRelease = latestRelease
32+
End Sub
33+
End Class
34+
End Namespace
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
' WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
2+
' Copyright (C) 2019-2021 Gawindx (Decaux Nicolas)
3+
'
4+
' This program is free software: you can redistribute it and/or modify it under the terms of the
5+
' GNU General Public License as published by the Free Software Foundation, either version 3 of the
6+
' License, or any later version.
7+
'
8+
' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY
9+
10+
Imports System.ComponentModel
11+
Imports System.IO
12+
13+
Namespace Updater
14+
''' <summary>
15+
''' Represent important details resulting from a completed async request to download an update.
16+
''' </summary>
17+
Public Class UpdateDownloadCompletedEventArgs
18+
Inherits AsyncCompletedEventArgs
19+
20+
Private ReadOnly _downloadedFile As FileInfo
21+
22+
ReadOnly Property DownloadedFile As FileInfo
23+
Get
24+
Return _downloadedFile
25+
End Get
26+
End Property
27+
28+
Public Sub New(downloadedFile As FileInfo, Optional [error] As Exception = Nothing,
29+
Optional cancelled As Boolean = False)
30+
31+
MyBase.New([error], cancelled, Nothing)
32+
_downloadedFile = downloadedFile
33+
End Sub
34+
End Class
35+
End Namespace
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Namespace Updater
2+
Public Class UpdateDownloadProgressChangedEventArgs
3+
Inherits EventArgs
4+
5+
Private _bytesDownloaded As Integer
6+
ReadOnly Property BytesDownloaded As Integer
7+
Get
8+
Return _bytesDownloaded
9+
End Get
10+
End Property
11+
12+
Public Sub New(bytesDown As Integer)
13+
_bytesDownloaded = bytesDown
14+
End Sub
15+
End Class
16+
End Namespace

WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)