Protogame.TreeView.BuildEntryGraph C# (CSharp) Метод

BuildEntryGraph() публичный Метод

public BuildEntryGraph ( Rectangle layout ) : TreeEntry
layout Microsoft.Xna.Framework.Rectangle
Результат TreeEntry
        public TreeEntry BuildEntryGraph(Rectangle layout)
        {
            var root = new TreeEntry
            {
                Item = null, 
                Layout = null, 
                Name = null, 
                FullName = string.Empty, 
                Children = new List<TreeEntry>(), 
                SegmentCount = 0
            };
            foreach (var item in _items.OrderBy(x => x.Text).ToArray())
            {
                var parent = FindParentForItem(root, item);
                if (parent == null)
                {
                    BackfillParentsForItem(root, item);
                }

                parent = FindParentForItem(root, item);
                var entry = new TreeEntry
                {
                    Item = item, 
                    Layout = null, 
                    Name = item.Text.Split('.').Last(), 
                    FullName = (parent.FullName + "." + item.Text.Split('.').Last()).Trim('.'), 
                    Children = new List<TreeEntry>(), 
                    SegmentCount = parent.SegmentCount + 1
                };
                parent.Children.Add(entry);
            }

            return root;
        }