/// <summary> /// Finds the specified match. /// </summary> /// <param name="match">The match.</param> /// <returns>LightCollection<TreeItem<T>>.</returns> public LightCollection <TreeItem <T> > Find(Predicate <TreeItem <T> > match) { LightCollection <TreeItem <T> > results = new LightCollection <TreeItem <T> >(); for (int i = 0; i < _globalCollection.Count; i++) { if (match(_globalCollection[i])) { results.Add(_globalCollection[i]); } } return(results); }
/// <summary> /// Initializes a new instance of the <see cref="Enumerator"/> struct. /// </summary> /// <param name="list">The list.</param> internal Enumerator(LightCollection <T> list) { _list = list; _index = 0; _current = default(T); }
/// <summary> /// Initializes a new instance of the <see cref="KeyedCollection{T}"/> class. /// </summary> /// <param name="keys">The keys.</param> /// <param name="items">The items.</param> public KeyedCollection(string[] keys, T[] items) { _keys = new LightCollection <string>(keys); _items = new LightCollection <T>(items); _readonlyColl = null; }
/// <summary> /// Initializes a new instance of the <see cref="KeyedCollection{T}"/> class. /// </summary> /// <param name="initialSize">The initial size.</param> public KeyedCollection(int initialSize) { _keys = new LightCollection <string>(initialSize); _items = new LightCollection <T>(initialSize); _readonlyColl = null; }
/// <summary> /// Initializes a new instance of the <see cref="ReadOnlyCollection{T}"/> class. /// </summary> /// <param name="collection">The collection.</param> public ReadOnlyCollection(ILightCollection <T> collection) { _coll = (LightCollection <T>)collection; // new LightCollection<T>(collection); }
/// <summary> /// Initializes a new instance of the <see cref="ReadOnlyCollection{T}"/> class. /// </summary> /// <param name="array">The array.</param> public ReadOnlyCollection(T[] array) { _coll = new LightCollection <T>(array); }
/// <summary> /// Initializes a new instance of the <see cref="TreeItemCollection{T}"/> class. /// </summary> /// <param name="ownerCollection">The owner collection.</param> /// <param name="parent">The parent.</param> /// <param name="items">The items.</param> internal TreeItemCollection(ref TreeCollection <T> ownerCollection, string parent, LightCollection <string> items) { _parent = parent; _items = new LightCollection <string>(items); _ownerCollection = ownerCollection; }
/// <summary> /// Initializes a new instance of the <see cref="TreeCollection{T}"/> class. /// </summary> /// <param name="initialSize">The initial size.</param> public TreeCollection(int initialSize) { _globalCollection = new KeyedCollection <TreeItem <T> >(initialSize); _globalValues = new KeyedCollection <T>(initialSize); _rootItems = new LightCollection <string>(); }
/// <summary> /// Initializes a new instance of the <see cref="TreeItemEnumerator{T}"/> class. /// </summary> /// <param name="globalCollection">The global collection.</param> /// <param name="rootItems">The root items.</param> internal TreeItemEnumerator(ref KeyedCollection <TreeItem <T> > globalCollection, LightCollection <string> rootItems) { _globalCollection = globalCollection; _rootItems = rootItems; }