mirror of
https://github.com/kimmknight/remoteapptool.git
synced 2024-11-21 21:17:20 +00:00
*All* app icons were previously (re)loaded from file every time an app is created or edited. Now icons are *individually* reloaded only when an app is added/edited, significantly improving performance. Addresses issue #136
This commit is contained in:
parent
fb4e4c03e1
commit
25681bcbbd
@ -12,7 +12,6 @@ Public Class RemoteAppEditWindow
|
||||
HelpSystem.SetupTips(Me)
|
||||
Me.LoadValues()
|
||||
Dim dlgResult = Me.ShowDialog()
|
||||
RemoteAppMainWindow.ReloadApps()
|
||||
Me.Dispose()
|
||||
Return RemoteApp
|
||||
End Function
|
||||
|
@ -52,13 +52,16 @@ Public Class RemoteAppMainWindow
|
||||
Apps = SystemApps.GetAll
|
||||
|
||||
For Each App As RemoteApp In Apps
|
||||
SmallIcons.Images.RemoveByKey(App.Name)
|
||||
' Check if the image is already present in SmallIcons before adding it
|
||||
If Not Me.SmallIcons.Images.ContainsKey(App.Name) Then
|
||||
Dim TheBitmap = GetAppBitmap(App.Name)
|
||||
Me.SmallIcons.Images.Add(App.Name, TheBitmap)
|
||||
End If
|
||||
|
||||
' Create the ListView item
|
||||
Dim AppItem As New ListViewItem(App.Name)
|
||||
AppItem.ToolTipText = App.FullName
|
||||
AppItem.ImageIndex = 0
|
||||
Me.SmallIcons.Images.Add(App.Name, TheBitmap)
|
||||
AppItem.ImageKey = App.Name
|
||||
AppItem.ImageKey = App.Name ' Use the ImageKey as it was set
|
||||
AppList.Items.Add(AppItem)
|
||||
Next
|
||||
|
||||
@ -116,10 +119,19 @@ Public Class RemoteAppMainWindow
|
||||
Private Sub EditRemoteApp(AppName As String)
|
||||
Dim sra As New SystemRemoteApps
|
||||
RemoteAppEditWindow.EditRemoteApp(sra.GetApp(AppName))
|
||||
DeleteImage(AppName)
|
||||
ReloadApps()
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteImage(AppName)
|
||||
If Me.SmallIcons.Images.ContainsKey(AppName) Then
|
||||
Me.SmallIcons.Images.RemoveByKey(AppName)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteButton_Click(sender As Object, e As EventArgs) Handles DeleteButton.Click
|
||||
DeleteRemoteApp(AppList.SelectedItems(0).Text)
|
||||
DeleteImage(AppList.SelectedItems(0).Text)
|
||||
ReloadApps()
|
||||
End Sub
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user