Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public Type GetViewType(INode node)
        {
            var kv = NodeViews.FirstOrDefault(d => node.Features[0].Equals(d.Key));

            return(kv.Value ?? typeof(Views.NodeViews.BasicNodeView));
        }