diff --git a/GBM/Classes/clsGame.vb b/GBM/Classes/clsGame.vb index 79fc9d0..693e915 100644 --- a/GBM/Classes/clsGame.vb +++ b/GBM/Classes/clsGame.vb @@ -28,6 +28,12 @@ End Get End Property + ReadOnly Property CompoundKey As String + Get + Return ProcessName & ":" & Name + End Get + End Property + ReadOnly Property CroppedName As String Get If Name.Length > 40 Then diff --git a/GBM/Forms/frmAdvancedImport.vb b/GBM/Forms/frmAdvancedImport.vb index ed7e884..3198a36 100644 --- a/GBM/Forms/frmAdvancedImport.vb +++ b/GBM/Forms/frmAdvancedImport.vb @@ -30,7 +30,7 @@ For Each de As DictionaryEntry In ImportData oApp = DirectCast(de.Value, clsGame) - oData = New KeyValuePair(Of String, String)(oApp.ProcessName, oApp.Name & " (" & oApp.TrueProcess & ")") + oData = New KeyValuePair(Of String, String)(oApp.CompoundKey, oApp.Name & " (" & oApp.TrueProcess & ")") lstGames.Items.Add(oData) Next End Sub diff --git a/GBM/Managers/mgrMonitorList.vb b/GBM/Managers/mgrMonitorList.vb index 5f8269e..6680f38 100644 --- a/GBM/Managers/mgrMonitorList.vb +++ b/GBM/Managers/mgrMonitorList.vb @@ -119,7 +119,6 @@ Public Class mgrMonitorList Dim oFromItem As clsGame Dim oToItem As clsGame Dim iChanges As Integer - Dim sCompareKey As String Cursor.Current = Cursors.WaitCursor @@ -141,11 +140,10 @@ Public Class mgrMonitorList hshSyncItems = hshCompareFrom.Clone For Each oFromItem In hshCompareFrom.Values - sCompareKey = oFromItem.ProcessName & ":" & oFromItem.Name - If hshCompareTo.Contains(sCompareKey) Then - oToItem = DirectCast(hshCompareTo(sCompareKey), clsGame) + If hshCompareTo.Contains(oFromItem.CompoundKey) Then + oToItem = DirectCast(hshCompareTo(oFromItem.CompoundKey), clsGame) If oFromItem.SyncEquals(oToItem) Then - hshSyncItems.Remove(sCompareKey) + hshSyncItems.Remove(oFromItem.CompoundKey) End If End If Next @@ -173,11 +171,10 @@ Public Class mgrMonitorList hshDeleteItems = hshCompareTo.Clone For Each oToItem In hshCompareTo.Values - sCompareKey = oToItem.ProcessName & ":" & oToItem.Name - If hshCompareFrom.Contains(sCompareKey) Then - oFromItem = DirectCast(hshCompareFrom(sCompareKey), clsGame) + If hshCompareFrom.Contains(oToItem.CompoundKey) Then + oFromItem = DirectCast(hshCompareFrom(oToItem.CompoundKey), clsGame) If oToItem.MinimalEquals(oFromItem) Then - hshDeleteItems.Remove(sCompareKey) + hshDeleteItems.Remove(oToItem.CompoundKey) End If End If Next @@ -199,7 +196,6 @@ Public Class mgrMonitorList Dim hshSyncItems As Hashtable Dim oFromItem As clsGame Dim oToItem As clsGame - Dim sCompareKey As String Cursor.Current = Cursors.WaitCursor @@ -210,11 +206,10 @@ Public Class mgrMonitorList hshSyncItems = hshCompareFrom.Clone For Each oFromItem In hshCompareFrom.Values - sCompareKey = oFromItem.ProcessName & ":" & oFromItem.Name - If hshCompareTo.Contains(sCompareKey) Then - oToItem = DirectCast(hshCompareTo(sCompareKey), clsGame) + If hshCompareTo.Contains(oFromItem.CompoundKey) Then + oToItem = DirectCast(hshCompareTo(oFromItem.CompoundKey), clsGame) If oFromItem.CoreEquals(oToItem) Then - hshSyncItems.Remove(sCompareKey) + hshSyncItems.Remove(oFromItem.CompoundKey) End If End If Next