Пример #1
0
        protected static IReadOnlyList <TreeOrphan> GetEnumerableChildren <TTreeOrphan>(IEnumerable <TTreeOrphan> children) where TTreeOrphan : TreeOrphan
        {
            if (children == null)
            {
                return(new OrphanList <TTreeOrphan>());
            }
            else
            {
                if (children is CachedEnumerableIterator <TTreeOrphan> )
                {
                    return(new OrphanList <TTreeOrphan>(new LazyOrphanList(children)));
                }
                else
                {
#if DEBUG
                    var orphanList = new OrphanList <TTreeOrphan>(children);

                    Debug.Assert(!orphanList.Contains(null), "TreeOrphans cannot contain null children");

                    return(orphanList);
#else
                    return(new OrphanList <TTreeOrphan>(children));
#endif
                }
            }
        }
Пример #2
0
 public OrphanListDebugView(OrphanList <TOrphan> list)
 {
     this.list = list;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrphanList{TOrphan}"/> class with an orphan list.
 /// </summary>
 /// <param name="list">The list this type will encapsulate.</param>
 internal OrphanList(OrphanList list)
 {
     this.list = list;
 }