Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1013


Ignore:
Timestamp:
12/17/08 15:55:02 (16 years ago)
Author:
whackl
Message:

added sort after date (#397)

Location:
trunk/sources/HeuristicLab.Hive.Client.Console
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs

    r1010 r1013  
    217217      myPane.AddPieSlice(perDone, Color.Green, 0.1, "");
    218218      myPane.AddPieSlice(perAborted, Color.Red, 0.1, "");
     219
     220      //Hides the slice labels
     221      PieItem.Default.LabelType = PieLabelType.None;
    219222     
    220223      myPane.AxisChange();
  • trunk/sources/HeuristicLab.Hive.Client.Console/ListViewColumnSorterDate.cs

    r1002 r1013  
    4444    /// <returns>The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y'</returns>
    4545    public int Compare(object x, object y) {
    46       int compareResult;
     46      int compareResult = 0;
    4747      ListViewItem listviewX, listviewY;
    4848
     
    5151      listviewY = (ListViewItem)y;
    5252
    53       // Compare the two items
    54       compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
     53      DateTime listviewDateX = new DateTime();
     54      DateTime listviewDateY = new DateTime();
    5555
     56      if (DateTime.TryParse(listviewX.SubItems[ColumnToSort].Text, out listviewDateX) && DateTime.TryParse(listviewY.SubItems[ColumnToSort].Text, out listviewDateX)) {
     57        compareResult = DateTime.Compare(listviewDateX, listviewDateY);
     58      } else {
     59        // Compare the two items
     60        compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
     61      }
    5662      // Calculate correct return value based on object comparison
    5763      if (OrderOfSort == SortOrder.Ascending) {
Note: See TracChangeset for help on using the changeset viewer.