public void Add(ResultItemBag resultItemBag) { // add based on sort order int pos = SortedBag.BinarySearch(resultItemBag, BaseComparer); if (pos < 0) { pos = ~pos; } SortedBag.Insert(pos, resultItemBag); }