Changeset 3444


Ignore:
Timestamp:
04/20/10 16:00:18 (11 years ago)
Author:
mkommend
Message:

reacted on TimeSpans in sorting and added protected virtual Sort method for derived classes (e.g. RunCollectionTabularView) (ticket #968)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r3431 r3444  
    294294
    295295    private void Sort() {
     296      virtualRowIndizes = Sort(sortedColumnIndizes);
     297      UpdateSortGlyph();
     298      dataGridView.Invalidate();
     299    }
     300    protected virtual int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {
    296301      int[] newSortedIndex = Enumerable.Range(0, Content.Rows).ToArray();
    297       if (sortedColumnIndizes.Count != 0) {
    298         rowComparer.SortedIndizes = sortedColumnIndizes;
     302      if (sortedColumns.Count() != 0) {
     303        rowComparer.SortedIndizes = sortedColumns;
    299304        rowComparer.Matrix = Content;
    300305        Array.Sort(newSortedIndex, rowComparer);
    301306      }
    302       virtualRowIndizes = newSortedIndex;
    303       UpdateSortGlyph();
    304       dataGridView.Invalidate();
    305     }
    306 
     307      return newSortedIndex;
     308    }
    307309    private void UpdateSortGlyph() {
    308310      foreach (DataGridViewColumn col in this.dataGridView.Columns)
     
    332334        double double1, double2;
    333335        DateTime dateTime1, dateTime2;
     336        TimeSpan timeSpan1, timeSpan2;
    334337        string string1, string2;
    335338
     
    346349          else if (DateTime.TryParse(string1, out dateTime1) && DateTime.TryParse(string2, out dateTime2))
    347350            result = dateTime1.CompareTo(dateTime2);
     351          else if (TimeSpan.TryParse(string1, out timeSpan1) && TimeSpan.TryParse(string2, out timeSpan2))
     352            result = timeSpan1.CompareTo(timeSpan2);
    348353          else {
    349354            if (string1 != null)
Note: See TracChangeset for help on using the changeset viewer.