mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
made all relevant classes use IConnectionTree
This commit is contained in:
@@ -7,7 +7,7 @@ namespace mRemoteNG.Tree
|
||||
{
|
||||
public class PreviouslyOpenedFolderExpander : IConnectionTreeDelegate
|
||||
{
|
||||
public void Execute(ConnectionTree connectionTree)
|
||||
public void Execute(IConnectionTree connectionTree)
|
||||
{
|
||||
var containerList = connectionTree.ConnectionTreeModel.GetRecursiveChildList(connectionTree.GetRootConnectionNode()).OfType<ContainerInfo>();
|
||||
var previouslyExpandedNodes = containerList.Where(container => container.IsExpanded);
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace mRemoteNG.Tree
|
||||
{
|
||||
public class RootNodeExpander : IConnectionTreeDelegate
|
||||
{
|
||||
public void Execute(ConnectionTree connectionTree)
|
||||
public void Execute(IConnectionTree connectionTree)
|
||||
{
|
||||
var rootConnectionNode = connectionTree.GetRootConnectionNode();
|
||||
connectionTree.InvokeExpand(rootConnectionNode);
|
||||
|
||||
@@ -14,7 +14,7 @@ using mRemoteNG.Tree.Root;
|
||||
|
||||
namespace mRemoteNG.UI.Controls
|
||||
{
|
||||
public partial class ConnectionTree : TreeListView
|
||||
public partial class ConnectionTree : TreeListView, IConnectionTree
|
||||
{
|
||||
private ConnectionTreeModel _connectionTreeModel;
|
||||
private readonly ConnectionTreeDragAndDropHandler _dragAndDropHandler = new ConnectionTreeDragAndDropHandler();
|
||||
@@ -32,7 +32,6 @@ namespace mRemoteNG.UI.Controls
|
||||
|
||||
public TreeNodeSingleClickHandler SingleClickHandler { get; set; } = new TreeNodeSingleClickHandler();
|
||||
|
||||
|
||||
public ConnectionTreeModel ConnectionTreeModel
|
||||
{
|
||||
get { return _connectionTreeModel; }
|
||||
@@ -159,6 +158,16 @@ namespace mRemoteNG.UI.Controls
|
||||
return (RootNodeInfo)Roots.Cast<ConnectionInfo>().First(item => item is RootNodeInfo);
|
||||
}
|
||||
|
||||
void IConnectionTree.InvokeExpand(object model)
|
||||
{
|
||||
this.InvokeExpand(model);
|
||||
}
|
||||
|
||||
void IConnectionTree.InvokeRebuildAll(bool preserveState)
|
||||
{
|
||||
this.InvokeRebuildAll(preserveState);
|
||||
}
|
||||
|
||||
public IEnumerable<RootPuttySessionsNodeInfo> GetRootPuttyNodes()
|
||||
{
|
||||
return Objects.OfType<RootPuttySessionsNodeInfo>();
|
||||
|
||||
@@ -3,6 +3,6 @@ namespace mRemoteNG.UI.Controls
|
||||
{
|
||||
public interface IConnectionTreeDelegate
|
||||
{
|
||||
void Execute(ConnectionTree connectionTree);
|
||||
void Execute(IConnectionTree connectionTree);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user