/// <summary> /// Merges current list with the list of lists specified in the parameter. /// </summary> /// <param name="lists">Lists to merge with.</param> /// <returns>Merged list.</returns> public PFListEx <T> Merge(PFListEx <PFListEx <T> > lists) { PFListEx <T> mergedList = new PFListEx <T>(); if (lists == null) { return(mergedList); } foreach (T item in this) { mergedList.Add(item); } for (int listInx = 0; listInx < lists.Count; listInx++) { PFListEx <T> tempList = lists[listInx]; if (tempList != null) { foreach (T item in tempList) { mergedList.Add(item); } } } return(mergedList); }
/// <summary> /// Merges current list with the list specified in the parameter. /// </summary> /// <param name="list">List to merge with.</param> /// <returns>Merged list.</returns> public PFListEx <T> Merge(PFListEx <T> list) { PFListEx <T> mergedList = new PFListEx <T>(); if (list == null) { return(mergedList); } foreach (T item in this) { mergedList.Add(item); } foreach (T item in list) { mergedList.Add(item); } return(mergedList); }
/// <summary> /// Converts current instance of a PFKeyValueListEx object to PFListEx object. /// </summary> /// <returns>PFListEx object.</returns> public PFListEx <pfKeyValuePair <TKey, TValue> > ConvertThisToPFListEx() { PFListEx <pfKeyValuePair <TKey, TValue> > list = new PFListEx <pfKeyValuePair <TKey, TValue> >(); pfKeyValuePair <TKey, TValue> kvp = default(pfKeyValuePair <TKey, TValue>); if (this.Count > 0) { this.SetToBOF(); kvp = this.FirstItem; while (this.EOF == false) { list.Add(new pfKeyValuePair <TKey, TValue>(kvp.Key, kvp.Value)); kvp = this.NextItem; } } return(list); }
/// <summary> /// Routine that concatenates two or more lists into one list. /// </summary> /// <param name="lists">List of list objects to be concatenated.</param> /// <returns>Concatenated list.</returns> public static PFListEx <T> ConcatenateLists(PFListEx <PFListEx <T> > lists) { PFListEx <T> concatenatedList = new PFListEx <T>(); if (lists == null) { return(concatenatedList); } for (int listInx = 0; listInx < lists.Count; listInx++) { PFListEx <T> tempList = lists[listInx]; if (tempList != null) { foreach (T item in tempList) { concatenatedList.Add(item); } } } return(concatenatedList); }