Exemple #1
0
 private void EnforceUniqueFields(SortSpec <TSortField> spec, int replaceIndex = -1)
 {
     for (int i = 0; i < Count; i++)
     {
         if (i != replaceIndex && this[i].Field.Equals(spec.Field))
         {
             throw new InvalidOperationException($"Cannot insert a sort specification for field {typeof(TSortField)}.{spec.Field} because one already exists.");
         }
     }
 }
Exemple #2
0
 protected override void SetItem(int index, SortSpec <TSortField> spec)
 {
     EnforceUniqueFields(spec, index);
     base.SetItem(index, spec);
 }