public void AddAfter(T anchor, T item) { if (anchor == null) { throw new ArgumentNullException(nameof(anchor)); } if (!_nodes.Contains(anchor)) { throw new InvalidOperationException("Anchor item not found in list"); } var anchorNode = _nodes[anchor].First(); var node = _tree.AddAfter(anchorNode, item); _nodes.Add(item, node); }
IEnumerable <object> _calcSelectedItemsFromSelectedValues() { if (_selectedValues == null) { yield break; } foreach (var key in _selectedValues.Cast <object>().Distinct()) { if (_keyToItems.Contains(key)) { foreach (var item in _keyToItems[key]) { yield return(item); } } } }