mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +08:00
19 lines
684 B
C#
19 lines
684 B
C#
using System.Linq;
|
|
using mRemoteNG.Container;
|
|
using mRemoteNG.UI.Controls;
|
|
|
|
|
|
namespace mRemoteNG.Tree
|
|
{
|
|
public class PreviouslyOpenedFolderExpander : IConnectionTreeDelegate
|
|
{
|
|
public void Execute(IConnectionTree connectionTree)
|
|
{
|
|
var rootNode = connectionTree.GetRootConnectionNode();
|
|
var containerList = connectionTree.ConnectionTreeModel.GetRecursiveChildList(rootNode).OfType<ContainerInfo>();
|
|
var previouslyExpandedNodes = containerList.Where(container => container.IsExpanded);
|
|
connectionTree.ExpandedObjects = previouslyExpandedNodes;
|
|
connectionTree.InvokeRebuildAll(true);
|
|
}
|
|
}
|
|
} |