mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
28 lines
789 B
C#
28 lines
789 B
C#
using System;
|
|
using mRemoteNG.Connection;
|
|
using mRemoteNG.Container;
|
|
using mRemoteNG.UI.Controls;
|
|
|
|
|
|
namespace mRemoteNG.Tree
|
|
{
|
|
public class ExpandNodeClickHandler : ITreeNodeClickHandler
|
|
{
|
|
private readonly IConnectionTree _connectionTree;
|
|
|
|
public ExpandNodeClickHandler(IConnectionTree connectionTree)
|
|
{
|
|
if (connectionTree == null)
|
|
throw new ArgumentNullException(nameof(connectionTree));
|
|
|
|
_connectionTree = connectionTree;
|
|
}
|
|
|
|
public void Execute(ConnectionInfo clickedNode)
|
|
{
|
|
var clickedNodeAsContainer = clickedNode as ContainerInfo;
|
|
if (clickedNodeAsContainer == null) return;
|
|
_connectionTree.ToggleExpansion(clickedNodeAsContainer);
|
|
}
|
|
}
|
|
} |