public ChainNodeView FindChainNodeView(ChainNode node, bool recurse) { var foundNode = NodeViews.FirstOrDefault(view => view.ChainNode == node); if (foundNode != null) { return(foundNode); } if (!recurse) { return(null); } foreach (var view in GroupViews) { foundNode = view.FindChainNodeView(node, true); if (foundNode != null) { return(foundNode); } } return(null); }
private void RemoveChainNodeView(ChainNode node, bool destroy) { if (ChainView.SelectedChainNode == node) { ChainView.SelectedChainNode = null; } if (node.Router.SelectionStatesEnumerable.Contains(ChainView.SelectedSelectionState)) { ChainView.SelectedSelectionState = null; } var view = NodeViews.FirstOrDefault(nv => nv.ChainNode == node); if (view == null) { return; } RemoveChainNodeView(view, destroy); }
public Type GetViewType(INode node) { var kv = NodeViews.FirstOrDefault(d => node.Features[0].Equals(d.Key)); return(kv.Value ?? typeof(Views.NodeViews.BasicNodeView)); }