Files
mRemoteNG/mRemoteNG/Tree/PreviouslyOpenedFolderExpander.cs
Dimitrij 83f3846ce6 lib updates
correct build number calculations - now its days from last release + hour + minute of build
some changes to migrate to json schema + preparation of using db to save settings
2024-05-03 14:40:52 +01:00

22 lines
930 B
C#

using System.Linq;
using System.Runtime.Versioning;
using mRemoteNG.Container;
using mRemoteNG.UI.Controls.ConnectionTree;
namespace mRemoteNG.Tree
{
[SupportedOSPlatform("windows")]
public class PreviouslyOpenedFolderExpander : IConnectionTreeDelegate
{
public void Execute(IConnectionTree connectionTree)
{
Root.RootNodeInfo rootNode = connectionTree.GetRootConnectionNode();
System.Collections.Generic.IEnumerable<ContainerInfo> containerList = connectionTree.ConnectionTreeModel.GetRecursiveChildList(rootNode)
.OfType<ContainerInfo>();
System.Collections.Generic.IEnumerable<ContainerInfo> previouslyExpandedNodes = containerList.Where(container => container.IsExpanded);
connectionTree.ExpandedObjects = previouslyExpandedNodes;
connectionTree.InvokeRebuildAll(true);
}
}
}