diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index b55470a2..60c6226c 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -4,6 +4,7 @@ using mRemoteNG.Container; using mRemoteNG.Tree; using System; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; @@ -175,7 +176,7 @@ namespace mRemoteNG.UI.Window private void SetModelUpdateHandlers() { - _puttySessionsManager.PuttySessionsCollectionChanged += (sender, args) => RefreshTreeObjects(olvConnections.Objects.OfType().ToList()); + _puttySessionsManager.PuttySessionsCollectionChanged += (sender, args) => RefreshTreeObjects(GetRootPuttyNodes().ToList()); } private void PopulateTreeView() @@ -198,6 +199,11 @@ namespace mRemoteNG.UI.Window return (RootNodeInfo)olvConnections.Roots.Cast().First(item => item is RootNodeInfo); } + private IEnumerable GetRootPuttyNodes() + { + return olvConnections.Objects.OfType(); + } + #region Form Stuff private void Tree_Load(object sender, EventArgs e) {