private void InnerAddChild(TNode node, int?insertIndex) { if (insertIndex < 0) { throw new ArgumentOutOfRangeException(nameof(insertIndex)); } if (!insertIndex.HasValue || insertIndex.Value >= ChildrenList.Count) { ChildrenList.Add(node); } else { ChildrenList.Insert(insertIndex.Value, node); } }