From 0e93d284ea8423df067768e1d8b4bf794f8d7738 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Tue, 22 Dec 2015 19:50:40 -0600 Subject: [PATCH] Moved strings to resource (frmAdvancedImport, frmChooseGame, frmFileFolderSearch, frmFilter) --- GBM/Forms/frmAdvancedImport.vb | 20 ++- GBM/Forms/frmChooseGame.vb | 20 ++- GBM/Forms/frmFileFolderSearch.vb | 16 +- GBM/Forms/frmFilter.vb | 29 +++- GBM/My Project/Resources.Designer.vb | 243 +++++++++++++++++++++++++++ GBM/My Project/Resources.resx | 81 +++++++++ 6 files changed, 394 insertions(+), 15 deletions(-) diff --git a/GBM/Forms/frmAdvancedImport.vb b/GBM/Forms/frmAdvancedImport.vb index 32fc37c..737d27b 100644 --- a/GBM/Forms/frmAdvancedImport.vb +++ b/GBM/Forms/frmAdvancedImport.vb @@ -1,4 +1,6 @@ -Public Class frmAdvancedImport +Imports GBM.My.Resources + +Public Class frmAdvancedImport Private hshImportData As Hashtable Private bSelectAll As Boolean = False @@ -36,8 +38,15 @@ End Sub Private Sub SetForm() + 'Set Form Name + Me.Text = frmAdvancedImport_FormName + + 'Set Form Text + btnCancel.Text = frmAdvancedImport_btnCancel + btnImport.Text = frmAdvancedImport_btnImport + chkSelectAll.Checked = True - lblGames.Text = ImportData.Count & " new configurations available." + lblGames.Text = mgrCommon.FormatString(frmAdvancedImport_NewConfigs, ImportData.Count) End Sub Private Sub BuildList() @@ -52,7 +61,7 @@ End Sub Private Sub UpdateSelected() - lblSelected.Text = lstGames.CheckedItems.Count & " Selected" + lblSelected.Text = mgrCommon.FormatString(frmAdvancedImport_Selected, lstGames.CheckedItems.Count) End Sub Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -61,11 +70,6 @@ LoadData() SelectToggle() bIsLoading = False - - Dim sResource As String = String.Empty - Dim sCode As String = String.Empty - mgrCommon.GetAllStrings(Me, sResource, sCode, "frmAdvancedImport") - Clipboard.SetText(sResource & vbCrLf & vbCrLf & sCode) End Sub Private Sub chkSelectAll_CheckedChanged(sender As Object, e As EventArgs) Handles chkSelectAll.CheckedChanged diff --git a/GBM/Forms/frmChooseGame.vb b/GBM/Forms/frmChooseGame.vb index 5b7ccc4..61460c7 100644 --- a/GBM/Forms/frmChooseGame.vb +++ b/GBM/Forms/frmChooseGame.vb @@ -1,4 +1,6 @@ -Public Class frmChooseGame +Imports GBM.My.Resources + +Public Class frmChooseGame Private oProcess As mgrProcesses Private oGame As clsGame @@ -49,9 +51,25 @@ Me.Close() End Sub + Private Sub SetForm() + 'Set Form Name + Me.Text = frmChooseGame_FormName + + 'Set Form Text + btnCancel.Text = frmChooseGame_btnCancel + btnChoose.Text = frmChooseGame_btnChoose + lblChoose.Text = frmChooseGame_lblChoose + End Sub + Private Sub frmChooseGame_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + SetForm() FillComboBox() Me.Focus() + + Dim sResource As String = String.Empty + Dim sCode As String = String.Empty + mgrCommon.GetAllStrings(Me, sResource, sCode, "frmChooseGame") + Clipboard.SetText(sResource & vbCrLf & vbCrLf & sCode) End Sub Private Sub btnChoose_Click(sender As System.Object, e As System.EventArgs) Handles btnChoose.Click diff --git a/GBM/Forms/frmFileFolderSearch.vb b/GBM/Forms/frmFileFolderSearch.vb index d7e20ed..f82236c 100644 --- a/GBM/Forms/frmFileFolderSearch.vb +++ b/GBM/Forms/frmFileFolderSearch.vb @@ -1,4 +1,5 @@ -Imports System.IO +Imports GBM.My.Resources +Imports System.IO Public Class frmFileFolderSearch Private sSearchItem As String @@ -135,9 +136,7 @@ Public Class frmFileFolderSearch If FoundItem = "Cancel" Then FoundItem = String.Empty If oDrives.Count > iCurrentDrive And FoundItem = String.Empty Then - oResult = mgrCommon.ShowMessage("The location was not found on the " & oSearchDrive.Root.ToString & _ - " drive. Do you wish to search the " & oDrives(iCurrentDrive).RootDirectory.ToString & _ - " drive?", MsgBoxStyle.YesNo) + oResult = mgrCommon.ShowMessage(frmFileFolderSearch_SwitchDrives, New String() {oSearchDrive.Root.ToString, oDrives(iCurrentDrive).RootDirectory.ToString}, MsgBoxStyle.YesNo) If oResult = MsgBoxResult.Yes Then Search(oDrives(iCurrentDrive)) Else @@ -150,7 +149,16 @@ Public Class frmFileFolderSearch End If End Sub + Private Sub SetForm() + 'Set Form Name + Me.Text = frmFileFolderSearch_FormName + + 'Set Form Text + btnCancel.Text = frmFileFolderSearch_btnCancel + End Sub + Private Sub frmFileFolderSearch_Load(sender As Object, e As EventArgs) Handles MyBase.Load + SetForm() GetDrives() Search(oDrives(iCurrentDrive)) End Sub diff --git a/GBM/Forms/frmFilter.vb b/GBM/Forms/frmFilter.vb index 0969094..83d2421 100644 --- a/GBM/Forms/frmFilter.vb +++ b/GBM/Forms/frmFilter.vb @@ -1,4 +1,6 @@ -Public Class frmFilter +Imports GBM.My.Resources + +Public Class frmFilter Public Enum eFilterType As Integer NoFilter = 1 @@ -111,10 +113,11 @@ If optGameInfo.Checked Then 'Set Filter Type If optAnd.Checked Then - eCurrentFilterType = eFilterType.FieldAnd + eCurrentFilterType = eFilterType.FieldAnd Else eCurrentFilterType = eFilterType.FieldOr End If + 'Set String Filter If txtName.Text <> String.Empty Then hshStringFilters.Add("Name", txtName.Text) @@ -144,7 +147,29 @@ End Sub + Private Sub SetForm() + 'Set Form Name + Me.Text = frmFilter_FormName + + 'Set Form Text + optOr.Text = frmFilter_optOr + optAnd.Text = frmFilter_optAnd + lblCompany.Text = frmFilter_lblCompany + lblProcess.Text = frmFilter_lblProcess + lblName.Text = frmFilter_lblName + optAll.Text = frmFilter_optAll + optAny.Text = frmFilter_optAny + lblGameTags.Text = frmFilter_lblGameTags + lblTags.Text = frmFilter_lblTags + btnRemove.Text = frmFilter_btnRemove + btnAdd.Text = frmFilter_btnAdd + btnOK.Text = frmFilter_btnOK + optTag.Text = frmFilter_optTag + optGameInfo.Text = frmFilter_optGameInfo + End Sub + Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load + SetForm() optGameInfo.Checked = True LoadData() End Sub diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 719bd00..ea1c7b1 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -663,6 +663,249 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to &Cancel. + ''' + Friend ReadOnly Property frmAdvancedImport_btnCancel() As String + Get + Return ResourceManager.GetString("frmAdvancedImport_btnCancel", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Import. + ''' + Friend ReadOnly Property frmAdvancedImport_btnImport() As String + Get + Return ResourceManager.GetString("frmAdvancedImport_btnImport", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Import Game Configurations. + ''' + Friend ReadOnly Property frmAdvancedImport_FormName() As String + Get + Return ResourceManager.GetString("frmAdvancedImport_FormName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to [PARAM] new configurations available.. + ''' + Friend ReadOnly Property frmAdvancedImport_NewConfigs() As String + Get + Return ResourceManager.GetString("frmAdvancedImport_NewConfigs", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to [PARAM] Selected. + ''' + Friend ReadOnly Property frmAdvancedImport_Selected() As String + Get + Return ResourceManager.GetString("frmAdvancedImport_Selected", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Cancel. + ''' + Friend ReadOnly Property frmChooseGame_btnCancel() As String + Get + Return ResourceManager.GetString("frmChooseGame_btnCancel", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to C&hoose Game. + ''' + Friend ReadOnly Property frmChooseGame_btnChoose() As String + Get + Return ResourceManager.GetString("frmChooseGame_btnChoose", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Choose Game. + ''' + Friend ReadOnly Property frmChooseGame_FormName() As String + Get + Return ResourceManager.GetString("frmChooseGame_FormName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Please choose the game you were playing:. + ''' + Friend ReadOnly Property frmChooseGame_lblChoose() As String + Get + Return ResourceManager.GetString("frmChooseGame_lblChoose", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Cancel. + ''' + Friend ReadOnly Property frmFileFolderSearch_btnCancel() As String + Get + Return ResourceManager.GetString("frmFileFolderSearch_btnCancel", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Search. + ''' + Friend ReadOnly Property frmFileFolderSearch_FormName() As String + Get + Return ResourceManager.GetString("frmFileFolderSearch_FormName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to The location was not found on the [PARAM] drive. Do you wish to search the [PARAM] drive?. + ''' + Friend ReadOnly Property frmFileFolderSearch_SwitchDrives() As String + Get + Return ResourceManager.GetString("frmFileFolderSearch_SwitchDrives", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to >. + ''' + Friend ReadOnly Property frmFilter_btnAdd() As String + Get + Return ResourceManager.GetString("frmFilter_btnAdd", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &OK. + ''' + Friend ReadOnly Property frmFilter_btnOK() As String + Get + Return ResourceManager.GetString("frmFilter_btnOK", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to <. + ''' + Friend ReadOnly Property frmFilter_btnRemove() As String + Get + Return ResourceManager.GetString("frmFilter_btnRemove", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Custom Filter. + ''' + Friend ReadOnly Property frmFilter_FormName() As String + Get + Return ResourceManager.GetString("frmFilter_FormName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Company:. + ''' + Friend ReadOnly Property frmFilter_lblCompany() As String + Get + Return ResourceManager.GetString("frmFilter_lblCompany", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Current Filter. + ''' + Friend ReadOnly Property frmFilter_lblGameTags() As String + Get + Return ResourceManager.GetString("frmFilter_lblGameTags", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Name:. + ''' + Friend ReadOnly Property frmFilter_lblName() As String + Get + Return ResourceManager.GetString("frmFilter_lblName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Process:. + ''' + Friend ReadOnly Property frmFilter_lblProcess() As String + Get + Return ResourceManager.GetString("frmFilter_lblProcess", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Available Tags. + ''' + Friend ReadOnly Property frmFilter_lblTags() As String + Get + Return ResourceManager.GetString("frmFilter_lblTags", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to All Tags. + ''' + Friend ReadOnly Property frmFilter_optAll() As String + Get + Return ResourceManager.GetString("frmFilter_optAll", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to And. + ''' + Friend ReadOnly Property frmFilter_optAnd() As String + Get + Return ResourceManager.GetString("frmFilter_optAnd", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Any Tag. + ''' + Friend ReadOnly Property frmFilter_optAny() As String + Get + Return ResourceManager.GetString("frmFilter_optAny", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Game Information. + ''' + Friend ReadOnly Property frmFilter_optGameInfo() As String + Get + Return ResourceManager.GetString("frmFilter_optGameInfo", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Or. + ''' + Friend ReadOnly Property frmFilter_optOr() As String + Get + Return ResourceManager.GetString("frmFilter_optOr", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Tag. + ''' + Friend ReadOnly Property frmFilter_optTag() As String + Get + Return ResourceManager.GetString("frmFilter_optTag", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to [PARAM] by [PARAM]. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 0690b58..7c75be4 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -862,4 +862,85 @@ Timestamp + + &Cancel + + + &Import + + + Import Game Configurations + + + [PARAM] new configurations available. + + + [PARAM] Selected + + + &Cancel + + + C&hoose Game + + + Choose Game + + + Please choose the game you were playing: + + + &Cancel + + + Search + + + The location was not found on the [PARAM] drive. Do you wish to search the [PARAM] drive? + + + > + + + &OK + + + < + + + Custom Filter + + + Company: + + + Current Filter + + + Name: + + + Process: + + + Available Tags + + + All Tags + + + And + + + Any Tag + + + Game Information + + + Or + + + Tag + \ No newline at end of file