Пример #1
0
        /// <summary>
        /// Add descendents to this instance and all ancestor instances.
        /// </summary>
        /// <param name="items"></param>
        /// <param name="depth"></param>
        private void AddDescendants(IEnumerable <ImageItem> items, int depth)
        {
            DescendantImages.AddRange(items.Select(p => new DescendantImageItem()
            {
                Item = p, Depth = depth
            }));

            if (Parent != null)
            {
                Parent.AddDescendants(items, depth + 1);
            }
        }