Moved remaining strings to resource (managers)

This commit is contained in:
Michael J. Seiferling
2015-12-24 11:19:53 -06:00
parent 51ca315edd
commit 88e0fa9afd
14 changed files with 817 additions and 131 deletions
+18 -17
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports GBM.My.Resources
Imports System.IO
Public Class mgrBackup
@@ -80,7 +81,7 @@ Public Class mgrBackup
oStream.Flush()
End Using
Catch ex As Exception
RaiseEvent UpdateLog("An error occured creating a file list: " & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorFileList, ex.Message), False, ToolTipIcon.Error, True)
End Try
End Sub
@@ -109,8 +110,8 @@ Public Class mgrBackup
RaiseEvent UpdateBackupInfo(oGame)
If mgrRestore.CheckManifest(oGame.Name) Then
If mgrCommon.ShowMessage("The manifest shows the backup folder contains a backup for " & oGame.Name & " that has not been restored on this computer." & vbCrLf & vbCrLf & "Do you want to overwrite this file anyway?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog("Backup aborted by user due to manifest conflict.", False, ToolTipIcon.Error, True)
If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True)
bDoBackup = False
End If
End If
@@ -122,7 +123,7 @@ Public Class mgrBackup
Directory.CreateDirectory(sBackupFile)
End If
Catch ex As Exception
RaiseEvent UpdateLog("Backup Aborted. A failure occured while creating backup sub-folder for " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
bDoBackup = False
End Try
End If
@@ -134,8 +135,8 @@ Public Class mgrBackup
End If
If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) Then
If mgrCommon.ShowMessage("A file with the same name already exists in the backup folder." & vbCrLf & vbCrLf & "Do you want to overwrite this file?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(oGame.Name & " backup aborted by user due to overwrite.", False, ToolTipIcon.Error, True)
If mgrCommon.ShowMessage(mgrBackup_ConfirmOverwrite, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOverwriteAbort, oGame.Name), False, ToolTipIcon.Error, True)
bDoBackup = False
End If
End If
@@ -173,11 +174,11 @@ Public Class mgrBackup
prs7z.StartInfo.RedirectStandardOutput = True
prs7z.StartInfo.CreateNoWindow = True
prs7z.Start()
RaiseEvent UpdateLog("Backup of " & sSavePath & " in progress...", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupInProgress, sSavePath), False, ToolTipIcon.Info, True)
While Not prs7z.StandardOutput.EndOfStream
If CancelOperation Then
prs7z.Kill()
RaiseEvent UpdateLog("Backup Aborted. The backup file for " & oGame.Name & " will be unusable.", True, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorFullAbort, oGame.Name), True, ToolTipIcon.Error, True)
Exit While
End If
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
@@ -185,28 +186,28 @@ Public Class mgrBackup
prs7z.WaitForExit()
If Not CancelOperation Then
If prs7z.ExitCode = 0 Then
RaiseEvent UpdateLog(oGame.Name & " backup completed.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, oGame.Name), False, ToolTipIcon.Info, True)
bBackupCompleted = True
Else
RaiseEvent UpdateLog(oGame.Name & " backup finished with warnings or errors.", True, ToolTipIcon.Warning, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
bBackupCompleted = False
End If
End If
prs7z.Dispose()
Else
RaiseEvent UpdateLog("Backup Aborted. The saved game path for " & oGame.Name & " does not exist.", True, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorNoSavePath, oGame.Name), True, ToolTipIcon.Error, True)
bBackupCompleted = False
End If
'Write Main Manifest
If bBackupCompleted Then
If oSettings.CheckSum Then
RaiseEvent UpdateLog("Generating SHA-256 hash for " & oGame.Name & " backup file.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True)
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
End If
If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then
RaiseEvent UpdateLog("The manifest update for " & oGame.Name & " failed.", True, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorManifestFailure, oGame.Name), True, ToolTipIcon.Error, True)
End If
'Write the process path if we have it
@@ -215,14 +216,14 @@ Public Class mgrBackup
End If
End If
Catch ex As Exception
RaiseEvent UpdateLog("An unexpected error occured during the backup of " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOtherFailure, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
End Try
End If
If bBackupCompleted Then
RaiseEvent SetLastAction(oGame.CroppedName & " backup completed")
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrBackup_ActionComplete, oGame.CroppedName))
Else
RaiseEvent SetLastAction(oGame.CroppedName & " backup failed")
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrBackup_ActionFailed, oGame.CroppedName))
End If
Next
End Sub
+6 -5
View File
@@ -1,4 +1,5 @@
Imports System.Net
Imports GBM.My.Resources
Imports System.Net
Public Class mgrCommon
@@ -34,9 +35,9 @@ Public Class mgrCommon
Public Shared Function BooleanYesNo(ByVal bBool As Boolean) As String
If bBool Then
Return "Yes"
Return mgrCommon_Yes
Else
Return "No"
Return mgrCommon_No
End If
End Function
@@ -44,7 +45,7 @@ Public Class mgrCommon
Dim fbBrowser As New SaveFileDialog
fbBrowser.Title = sTitle
fbBrowser.DefaultExt = sExtension
fbBrowser.Filter = sFileType & " files (*." & sExtension & ")|*." & sExtension
fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension})
fbBrowser.InitialDirectory = sDefaultFolder
fbBrowser.FileName = sDefaultFile
@@ -59,7 +60,7 @@ Public Class mgrCommon
Dim fbBrowser As New OpenFileDialog
fbBrowser.Title = sTitle
fbBrowser.DefaultExt = sExtension
fbBrowser.Filter = sFileType & " files (*." & sExtension & ")|*." & sExtension
fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension})
fbBrowser.InitialDirectory = sDefaultFolder
fbBrowser.Multiselect = bMulti
-1
View File
@@ -1,5 +1,4 @@
Imports System.IO
Imports System.Security
Imports System.Security.Cryptography
Public Class mgrHash
+1 -3
View File
@@ -1,6 +1,4 @@
Imports System.IO
Public Class mgrManifest
Public Class mgrManifest
Public Shared Function ReadManifest(ByVal iSelectDB As mgrSQLite.Database) As SortedList
Dim oDatabase As New mgrSQLite(iSelectDB)
+12 -13
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports GBM.My.Resources
Imports System.IO
Public Class mgrMonitorList
@@ -23,9 +24,7 @@ Public Class mgrMonitorList
'If the remote database actually contains a list, then ask what to do
If iGameCount > 0 Then
If mgrCommon.ShowMessage("GBM data already exists in the backup folder." & vbCrLf & vbCrLf & _
"Do you want to make your local game list the new master game list in this folder? (Recommended)" & vbCrLf & vbCrLf & _
"Choosing No will sync your local game list to the current master game list in this folder.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.ShowMessage(mgrMonitorList_ConfirmExistingData, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.SyncMonitorLists()
Else
mgrMonitorList.SyncMonitorLists(False)
@@ -45,7 +44,7 @@ Public Class mgrMonitorList
Dim oStringFilters As New Hashtable
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter
If mgrCommon.ShowMessage("Would you like to apply a filter to your export?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.ShowMessage(mgrMonitorList_ConfirmApplyFilter, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim frm As New frmFilter
frm.ShowDialog()
oTagFilters = frm.TagFilters
@@ -58,7 +57,7 @@ Public Class mgrMonitorList
bSuccess = mgrXML.SerializeAndExport(oList, sLocation)
If bSuccess Then
mgrCommon.ShowMessage("Export Complete. " & oList.Count & " item(s) have been exported.", MsgBoxStyle.Information)
mgrCommon.ShowMessage(mgrMonitorList_ExportComplete, oList.Count, MsgBoxStyle.Information)
End If
End Sub
@@ -130,9 +129,9 @@ Public Class mgrMonitorList
Cursor.Current = Cursors.WaitCursor
If bToRemote Then
RaiseEvent UpdateLog("A sync to the master game list has been triggered.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrMonitorList_SyncToMaster, False, ToolTipIcon.Info, True)
Else
RaiseEvent UpdateLog("A sync from the master game list has been triggered.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrMonitorList_SyncFromMaster, False, ToolTipIcon.Info, True)
End If
'Add / Update Sync
@@ -192,7 +191,7 @@ Public Class mgrMonitorList
DoListDeleteSync(hshDeleteItems, mgrSQLite.Database.Local)
End If
RaiseEvent UpdateLog(hshDeleteItems.Count + hshSyncItems.Count + iChanges & " change(s) synced.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrMonitorList_SyncChanges, (hshDeleteItems.Count + hshSyncItems.Count + iChanges).ToString), False, ToolTipIcon.Info, True)
Cursor.Current = Cursors.Default
Application.DoEvents()
End Sub
@@ -233,10 +232,10 @@ Public Class mgrMonitorList
mgrTags.DoTagAddImport(frm.ImportData)
Cursor.Current = Cursors.Default
mgrCommon.ShowMessage("Import Complete.", MsgBoxStyle.Information)
mgrCommon.ShowMessage(mgrMonitorList_ImportComplete, MsgBoxStyle.Information)
End If
Else
mgrCommon.ShowMessage("This list does not contain any new games to import.", MsgBoxStyle.Information)
mgrCommon.ShowMessage(mgrMonitorList_ImportNothing, MsgBoxStyle.Information)
End If
Application.DoEvents()
@@ -249,7 +248,7 @@ Public Class mgrMonitorList
ImportMonitorList(sPath, True)
Return True
Else
mgrCommon.ShowMessage("There's no response from:" & vbCrLf & vbCrLf & sPath & vbCrLf & vbCrLf & "Either the server is not responding or the URL is invalid.", MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrMonitorList_WebNoReponse, sPath, MsgBoxStyle.Exclamation)
Return False
End If
Else
@@ -257,7 +256,7 @@ Public Class mgrMonitorList
ImportMonitorList(sPath)
Return True
Else
mgrCommon.ShowMessage("The file:" & vbCrLf & sPath & vbCrLf & "cannot be found.", MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrMonitorList_FileNotFound, sPath, MsgBoxStyle.Exclamation)
Return False
End If
End If
+8 -40
View File
@@ -9,10 +9,6 @@ Public Class mgrPath
Private Shared sDBLocation As String = sSettingsRoot & "\gbm.s3db"
Private Shared sIncludeFile As String = sSettingsRoot & "\gbm_include.txt"
Private Shared sExcludeFile As String = sSettingsRoot & "\gbm_exclude.txt"
Private Shared sOfficialWebURL As String = App_URLWebsite
Private Shared sOfficialImportURL As String = App_URLImport
Private Shared sOfficialManualURL As String = App_URLManual
Private Shared sOfficialUpdatesURL As String = App_URLUpdates
Private Shared sRemoteDatabaseLocation As String
Private Shared hshCustomVariables As Hashtable
Private Shared oReleaseType As ProcessorArchitecture = AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture
@@ -77,30 +73,6 @@ Public Class mgrPath
End Get
End Property
Shared ReadOnly Property OfficialWebURL As String
Get
Return sOfficialWebURL
End Get
End Property
Shared ReadOnly Property OfficialManualURL As String
Get
Return sOfficialManualURL
End Get
End Property
Shared ReadOnly Property OfficialUpdatesURL As String
Get
Return sOfficialUpdatesURL
End Get
End Property
Shared ReadOnly Property OfficialImportURL As String
Get
Return sOfficialImportURL
End Get
End Property
Shared ReadOnly Property SettingsRoot As String
Get
Return sSettingsRoot
@@ -326,11 +298,11 @@ Public Class mgrPath
hshCustomVariables = mgrVariables.ReadVariables
End Sub
Public Shared Function SetManualgamePath() As String
Public Shared Function SetManualGamePath() As String
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim sNewPath As String
sNewPath = mgrCommon.OpenFolderBrowser("Choose the game folder containing the executable.", sDefaultFolder, False)
sNewPath = mgrCommon.OpenFolderBrowser(mgrPath_ChoosePath, sDefaultFolder, False)
Return sNewPath
End Function
@@ -346,7 +318,7 @@ Public Class mgrPath
'We can't automatically search for certain game types
If bNoAuto Then
sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to manually set the game path? (Path will be saved)"
sMessage = mgrCommon.FormatString(mgrPath_ConfirmManualPath, sSearchReason)
If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
sFolder = SetManualgamePath()
@@ -355,15 +327,14 @@ Public Class mgrPath
Return sFolder
End If
sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to automatically search for the game path? (Path will be saved)"
sMessage = mgrCommon.FormatString(mgrPath_ConfirmAutoPath, sSearchReason)
If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
frmFind.ShowDialog()
If frmFind.FoundItem <> String.Empty Then
sFolder = IO.Path.GetDirectoryName(frmFind.FoundItem)
sMessage = sGameName & " was located in the following folder:" & vbCrLf & vbCrLf & _
sFolder & vbCrLf & vbCrLf & "Is this correct?"
sMessage = mgrCommon.FormatString(mgrPath_ConfirmPathCorrect, New String() {sGameName, sFolder})
If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Return sFolder
Else
@@ -374,10 +345,9 @@ Public Class mgrPath
End If
If bSearchFailed Then
sMessage = "The search failed to locate the path for " & sGameName & "." & vbCrLf & vbCrLf & _
"Do you wish to manually set the game path? (Path will be saved)"
sMessage = mgrCommon.FormatString(mgrPath_ConfirmAutoFailure, sGameName)
Else
sMessage = "Do you wish to manually set the game path? (Path will be saved)"
sMessage = mgPath_ConfirmManualPathNoParam
End If
If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
@@ -392,9 +362,7 @@ Public Class mgrPath
Dim dBrowser As FolderBrowserDialog
If Not Directory.Exists(sBackupPath) Then
If mgrCommon.ShowMessage("The backup location " & sBackupPath & " is not available." & vbCrLf & _
"It may be on an external or network drive that isn't connected." & vbCrLf & vbCrLf & _
"Do you want to select another backup location and continue?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.ShowMessage(mgrPath_ConfirmBackupLocation, sBackupPath, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
dBrowser = New FolderBrowserDialog
dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
If dBrowser.ShowDialog = DialogResult.OK Then
+20 -22
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports GBM.My.Resources
Imports System.IO
Public Class mgrRestore
@@ -31,8 +32,7 @@ Public Class mgrRestore
Dim oResult As MsgBoxResult
If oCheckBackup.RestorePath <> oCheckGame.Path Then
oResult = mgrCommon.ShowMessage("The restore path for " & oCheckBackup.CroppedName & " does not match it's current save path." & vbCrLf & vbCrLf & _
"Do you want to restore to the current save path instead? (Recommended)", MsgBoxStyle.YesNoCancel)
oResult = mgrCommon.ShowMessage(mgrRestore_ConfirmPathMismatch, oCheckBackup.CroppedName, MsgBoxStyle.YesNoCancel)
If oResult = MsgBoxResult.Yes Then
If Path.IsPathRooted(oCheckGame.Path) Then
oCheckBackup.AbsolutePath = True
@@ -64,7 +64,7 @@ Public Class mgrRestore
Else
sProcess = oGame.TrueProcess
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
sRestorePath = mgrPath.ProcessPathSearch(oRestoreInfo.Name, sProcess, oRestoreInfo.Name & " uses a relative path and has never been detected on this computer.", bNoAuto)
sRestorePath = mgrPath.ProcessPathSearch(oRestoreInfo.Name, sProcess, mgrCommon.FormatString(mgrRestore_RelativeNeedPath, oRestoreInfo.Name), bNoAuto)
If sRestorePath <> String.Empty Then
'Update the process path in game object, save it, and make sure a monitor list reload is triggered
@@ -198,16 +198,15 @@ Public Class mgrRestore
'Check if restore location exists, prompt to create if it doesn't.
If Not Directory.Exists(sExtractPath) Then
If mgrCommon.ShowMessage("The restore path " & sExtractPath & " does not exist." & vbCrLf & vbCrLf & _
"Do you want to create the folder and continue?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.ShowMessage(mgrRestore_ConfirmCreatePath, sExtractPath, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Try
Directory.CreateDirectory(sExtractPath)
Catch ex As Exception
RaiseEvent UpdateLog("The restore path could not be created due to an unexpected error." & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorCreatePath, ex.Message), False, ToolTipIcon.Error, True)
bDoRestore = False
End Try
Else
RaiseEvent UpdateLog("Restored Aborted. The path " & sExtractPath & " does not exist.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True)
bDoRestore = False
End If
End If
@@ -217,17 +216,16 @@ Public Class mgrRestore
If oBackupInfo.CheckSum <> String.Empty Then
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
If sHash <> oBackupInfo.CheckSum Then
RaiseEvent UpdateLog("The backup file for " & oBackupInfo.Name & " has failed the file integrity check.", False, ToolTipIcon.Info, True)
If mgrCommon.ShowMessage("The backup file for " & oBackupInfo.Name & " has failed the file intergity check. It may be corrupted, not exist or been modified by another application." & vbCrLf & vbCrLf & _
"Do you still want to restore this backup? (Not Recommended)", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog("Restored Aborted by user due to a failed file integrity check.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True)
If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True)
bDoRestore = False
End If
Else
RaiseEvent UpdateLog(oBackupInfo.Name & " backup has been verified.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True)
End If
Else
RaiseEvent UpdateLog(oBackupInfo.Name & " has no stored checksum, verification has been skipped.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True)
End If
End If
@@ -240,11 +238,11 @@ Public Class mgrRestore
prs7z.StartInfo.RedirectStandardOutput = True
prs7z.StartInfo.CreateNoWindow = True
prs7z.Start()
RaiseEvent UpdateLog("Restore to " & sExtractPath & " in progress...", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreInProgress, sExtractPath), False, ToolTipIcon.Info, True)
While Not prs7z.StandardOutput.EndOfStream
If CancelOperation Then
prs7z.Kill()
RaiseEvent UpdateLog("Restored Aborted. The saved games for " & oBackupInfo.Name & " may now be invalid.", True, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFullAbort, oBackupInfo.Name), True, ToolTipIcon.Error, True)
Exit While
End If
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
@@ -252,16 +250,16 @@ Public Class mgrRestore
prs7z.WaitForExit()
If Not CancelOperation Then
If prs7z.ExitCode = 0 Then
RaiseEvent UpdateLog(oBackupInfo.Name & " backup restored.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreComplete, oBackupInfo.Name), False, ToolTipIcon.Info, True)
bRestoreCompleted = True
Else
RaiseEvent UpdateLog(oBackupInfo.Name & " restore finished with warnings or errors.", True, ToolTipIcon.Warning, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreWarnings, oBackupInfo.Name), True, ToolTipIcon.Warning, True)
bRestoreCompleted = False
End If
End If
prs7z.Dispose()
Else
RaiseEvent UpdateLog("Restore Aborted. The backup file could not be found.", True, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrRestore_ErrorNoBackup, True, ToolTipIcon.Error, True)
End If
If bRestoreCompleted Then
@@ -273,13 +271,13 @@ Public Class mgrRestore
End If
End If
Catch ex As Exception
RaiseEvent UpdateLog("An unexpected error occured during the restore process." & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorOtherFailure, ex.Message), False, ToolTipIcon.Error, True)
End Try
If bRestoreCompleted Then
RaiseEvent SetLastAction(oBackupInfo.CroppedName & " backup restored")
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionComplete, oBackupInfo.CroppedName))
Else
RaiseEvent SetLastAction(oBackupInfo.CroppedName & " restore failed")
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionFailed, oBackupInfo.CroppedName))
End If
End If
Next
+23 -22
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports GBM.My.Resources
Imports System.IO
Imports System.Data.SQLite
Public Class mgrSQLite
@@ -39,7 +40,7 @@ Public Class mgrSQLite
File.Copy(mgrPath.RemoteDatabaseLocation, sNewFile, False)
End Select
Catch ex As Exception
mgrCommon.ShowMessage("An error occured creating a backup of the database file at " & sNewFile & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrSQLite_ErrorBackupFailure, New String() {sNewFile, ex.Message}, MsgBoxStyle.Exclamation)
End Try
End Sub
@@ -75,9 +76,9 @@ Public Class mgrSQLite
"SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL);"
'Add Tables (Monitor List)
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & _
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & _
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & _
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"PRIMARY KEY(Name, Process));"
'Add Tables (Tags)
@@ -90,7 +91,7 @@ Public Class mgrSQLite
sSql &= "CREATE TABLE variables (VariableID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
'Add Tables (Local Manifest)
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & _
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " &
"AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
'Set Version
@@ -98,8 +99,8 @@ Public Class mgrSQLite
RunParamQuery(sSql, New Hashtable)
Return True
Catch e As Exception
mgrCommon.ShowMessage("An error has occured attempting to create the local application database: " & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Critical)
Catch ex As Exception
mgrCommon.ShowMessage(mgrSQLite_ErrorCreatingLocalDB, ex.Message, MsgBoxStyle.Critical)
Return False
End Try
End Function
@@ -112,13 +113,13 @@ Public Class mgrSQLite
SQLiteConnection.CreateFile(sDatabaseLocation)
'Add Tables (Remote Monitor List)
sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & _
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & _
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & _
sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"PRIMARY KEY(Name, Process));"
'Add Tables (Remote Manifest)
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & _
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " &
"AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
'Add Tables (Remote Tags)
@@ -132,8 +133,8 @@ Public Class mgrSQLite
RunParamQuery(sSql, New Hashtable)
Return True
Catch e As Exception
mgrCommon.ShowMessage("An error has occured attempting to create the remote application database: " & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Critical)
Catch ex As Exception
mgrCommon.ShowMessage(mgrSQLite_ErrorCreatingRemoteDB, ex.Message, MsgBoxStyle.Critical)
Return False
End Try
End Function
@@ -183,9 +184,9 @@ Public Class mgrSQLite
Try
command.ExecuteNonQuery()
trans.Commit()
Catch e As Exception
Catch ex As Exception
trans.Rollback()
mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False
Finally
command.Dispose()
@@ -209,9 +210,9 @@ Public Class mgrSQLite
command.ExecuteNonQuery()
Next
trans.Commit()
Catch e As Exception
Catch ex As Exception
trans.Rollback()
mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False
Finally
command.Dispose()
@@ -233,8 +234,8 @@ Public Class mgrSQLite
Try
adapter = New SQLiteDataAdapter(command)
adapter.Fill(oData)
Catch e As Exception
mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Catch ex As Exception
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Finally
command.Dispose()
Disconnect()
@@ -523,8 +524,8 @@ Public Class mgrSQLite
Try
command.ExecuteNonQuery()
Catch e As Exception
mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Catch ex As Exception
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Finally
command.Dispose()
Disconnect()
+4 -3
View File
@@ -1,4 +1,5 @@
Imports System.Xml.Serialization
Imports GBM.My.Resources
Imports System.Xml.Serialization
Imports System.IO
Imports System.Net
@@ -60,7 +61,7 @@ Public Class mgrXML
oList = oSerializer.Deserialize(oReader)
oReader.Close()
Catch ex As Exception
mgrCommon.ShowMessage("The XML file cannot be read, it may be an invalid format or corrupted." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation)
End Try
Return oList
@@ -78,7 +79,7 @@ Public Class mgrXML
oWriter.Close()
Return True
Catch ex As Exception
mgrCommon.ShowMessage("An error occured exporting the XML data." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(mgrXML_ErrorExportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try
End Function