public NodeSelectForm(INode rootNode, Func <T, bool> filter = null) { InitializeComponent(); if (StyleSet.CurrentStyle != null) { StyleHelpers.ApplyStyle(this, StyleSet.CurrentStyle); } Icon = ResourceStore.LoadIcon("Icons/Application.ico"); mRootNode = new ReferenceNode(rootNode); mRootNode.Populate(); foreach (var node in mRootNode.Nodes) { if (node.DataType != typeof(T)) { continue; } if (filter != null && !filter(( T )node.Data)) { continue; } mNodeTreeView.Nodes.Add(new NodeAsTreeNode(new ReferenceNode(node), true) { HideContextMenuStrip = true }); } StyleHelpers.ApplySystemFont(this); }