private ITreeNode createPathElementNodeFor(ITreeNode node, PathElement pathElement)
        {
            var pathElementNode = _treeNodeFactory.CreateFor(pathElement.DisplayName, $"{node.Id}-{pathElement.DisplayName}", pathElement.IconName);

            var existingNode = node.Children.Find(n => Equals(n.Id, pathElementNode.Id));

            if (existingNode != null)
            {
                return(existingNode);
            }

            node.AddChild(pathElementNode);
            return(pathElementNode);
        }
        private ITreeNode createPathElementNodeFor(ITreeNode node, PathElementDTO pathElementDTO)
        {
            var pathElementNode = _treeNodeFactory.CreateFor(pathElementDTO.DisplayName, string.Format("{0}-{1}", node.Id, pathElementDTO.DisplayName), pathElementDTO.IconName);

            var existingNode = node.Children.Find(n => Equals(n.Id, pathElementNode.Id));

            if (existingNode != null)
            {
                return(existingNode);
            }

            node.AddChild(pathElementNode);
            return(pathElementNode);
        }
        private ITreeNode mapFrom(IGroup group, Func <IGroup, string> display)
        {
            ITreeNode node = _treeNodeFactory.CreateFor(group);

            node.Text = display(group);
            node.Icon = ApplicationIcons.IconByName(group.IconName);

            group.Children.Where(g => g.Visible)
            .OrderBy(g => g.Sequence)
            .ThenBy(display)
            .Each(childGroup => node.AddChild(mapFrom(childGroup, display)));

            return(node);
        }
Beispiel #4
0
        private ITreeNode nodeFor <T>(T entity) where T : class, IEntity
        {
            var representationInfo = _representationInfoRepository.InfoFor(entity);

            return(_treeNodeFactory.CreateFor(entity, representationInfo));
        }