mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Fix CA1063
This commit is contained in:
@@ -69,18 +69,15 @@ namespace mRemoteNG.UI.Controls
|
||||
|
||||
var connected = connection.OpenConnections.Count > 0;
|
||||
var name = BuildConnectionIconName(connection.Icon, connected);
|
||||
if (!ImageList.Images.ContainsKey(name))
|
||||
if (ImageList.Images.ContainsKey(name)) return name;
|
||||
var image = ConnectionIcon.FromString(connection.Icon);
|
||||
if (image == null)
|
||||
{
|
||||
var image = ConnectionIcon.FromString(connection.Icon);
|
||||
if (image == null)
|
||||
{
|
||||
return DefaultConnectionIcon;
|
||||
}
|
||||
|
||||
ImageList.Images.Add(BuildConnectionIconName(connection.Icon, false), image);
|
||||
ImageList.Images.Add(BuildConnectionIconName(connection.Icon, true), Overlay(image, Resources.ConnectedOverlay));
|
||||
|
||||
return DefaultConnectionIcon;
|
||||
}
|
||||
|
||||
ImageList.Images.Add(BuildConnectionIconName(connection.Icon, false), image);
|
||||
ImageList.Images.Add(BuildConnectionIconName(connection.Icon, true), Overlay(image, Resources.ConnectedOverlay));
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -110,7 +107,16 @@ namespace mRemoteNG.UI.Controls
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ImageList?.Dispose();
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
ImageList?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user