示例#1
0
 public void AddSuffix(int aOrder, string aValue)
 {
     if (string.IsNullOrEmpty(aValue) == false)
     {
         TXffix item = new TXffix(aOrder, aValue);
         InsertInSortedOrder(ref iSuffixes, item);
     }
 }
示例#2
0
 private void InsertInSortedOrder(ref List <TXffix> aList, TXffix aValue)
 {
     if (aList == null)
     {
         aList = new List <TXffix>();
         aList.Add(aValue);
     }
     else
     {
         int pos = aList.BinarySearch(aValue, aValue as IComparer <TXffix>);
         if (pos < 0)
         {
             pos = ~pos;
         }
         aList.Insert(pos, aValue);
     }
 }