Update for issue #33

This commit is contained in:
Michael J. Seiferling
2016-02-06 09:28:39 -06:00
parent 5947b7d0b2
commit abbc6a4a70
5 changed files with 25 additions and 12 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ Public Class mgrBackup
prs7z.WaitForExit()
If Not CancelOperation Then
If prs7z.ExitCode = 0 Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, oGame.Name), False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, New String() {oGame.Name, mgrCommon.GetFileSize(sBackupFile)}), False, ToolTipIcon.Info, True)
bBackupCompleted = True
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
+20
View File
@@ -142,6 +142,26 @@ Public Class mgrCommon
End Try
End Sub
'Get a file size
Public Shared Function GetFileSize(ByVal sFile As String) As String
Dim oFileInfo As FileInfo
Dim dFileSize As Double
Try
oFileInfo = New FileInfo(sFile)
dFileSize = oFileInfo.Length
If dFileSize > 1048576 Then
Return FormatString(App_MB, Math.Round(dFileSize / 1048576, 2).ToString)
Else
Return FormatString(App_KB, Math.Round(dFileSize / 1024, 2).ToString)
End If
Catch ex As Exception
Return String.Empty
End Try
End Function
'Handles no extra parameters
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
Dim oResult As MsgBoxResult