Example #1
0
        TreeGridNode GetOrCreateChildNode(int index)
        {
            TreeGridNode child;

            if (this.childNodes == null)
            {
                this.childNodes = new SortedDictionary <int, TreeGridNode>();
            }

            if (!this.childNodes.TryGetValue(index, out child))
            {
                if (index < 0 || index >= this.items.Count)
                {
                    Debug.Fail("What...?");
                }

                child = new ChildTreeGridNode(this)
                {
                    childIndex = index, level = (short)(this.level + 1)
                };
                this.childNodes.Add(index, child);
            }

            return(child);
        }
        TreeGridNode GetOrCreateChildNode(int index)
        {
            TreeGridNode child;

            if (this.childNodes == null)
            {
                this.childNodes = new SortedDictionary<int, TreeGridNode>();
            }

            if (!this.childNodes.TryGetValue(index, out child))
            {
                if (index < 0 || index >= this.items.Count)
                {
                    Debug.Fail("What...?");
                }

                child = new ChildTreeGridNode(this) { childIndex = index, level = (short)(this.level + 1) };
                this.childNodes.Add(index, child);
            }

            return child;
        }