Esempio n. 1
0
        ///<summary>
        /// Finds a collection of <see cref="IEntity" /> objects in the current list matching the search criteria.
        ///</summary>
        /// <param name="findAllByType"><see cref="FindAllByType" /> Type to easily search by</param>
        /// <param name="propertyName">Property of the object to search.</param>
        /// <param name="value">Value to find.</param>
        /// <param name="ignoreCase">A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).  String properties only.</param>
        public virtual VList <T> FindAllBy(FindAllByType findAllByType, string propertyName, object value, bool ignoreCase)
        {
            PropertyDescriptorCollection props    = base.PropertyCollection;
            PropertyDescriptor           searchBy = props.Find(propertyName, true);

            VList <T> result = new VList <T>();

            int index = 0;

            while (index > -1)
            {
                index = this.FindAllBy(findAllByType, searchBy, value, index, ignoreCase);

                if (index > -1)
                {
                    result.Add(this[index]);

                    //Increment the index to start at the next item
                    index++;
                }
            }

            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Performs the specified action on each element of the specified array.
 /// </summary>
 /// <param name="list">The list.</param>
 /// <param name="action">The action.</param>
 public static void ForEach <U>(VList <U> list, Action <U> action)
 {
     list.ForEach(action);
 }