Changeset 8718 for trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3
- Timestamp:
- 10/02/12 12:50:39 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj
r8708 r8718 97 97 <ItemGroup> 98 98 <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" /> 99 <Compile Include="ListViewItem Comparer.cs" />99 <Compile Include="ListViewItemDateComparer.cs" /> 100 100 <Compile Include="Plugin.cs" /> 101 101 <Compile Include="Views\HiveJobManagerView.cs"> -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ListViewItemDateComparer.cs
r8717 r8718 29 29 /// See: http://msdn.microsoft.com/en-us/library/ms996467.aspx 30 30 /// </summary> 31 public class ListViewItem Comparer : IComparer {31 public class ListViewItemDateComparer : IComparer { 32 32 private int col; 33 33 private SortOrder order; 34 34 35 public ListViewItem Comparer() {35 public ListViewItemDateComparer() { 36 36 col = 0; 37 37 order = SortOrder.Ascending; 38 38 } 39 39 40 public ListViewItem Comparer(int column, SortOrder order) {40 public ListViewItemDateComparer(int column, SortOrder order) { 41 41 col = column; 42 42 this.order = order; … … 52 52 53 53 if (listViewItemX == null || listViewItemY == null) { 54 throw new ArgumentException(string.Format("The ListViewItem Comparer expects ListViewItems but received {0} and {1}.",54 throw new ArgumentException(string.Format("The ListViewItemDateComparer expects ListViewItems but received {0} and {1}.", 55 55 x.GetType().ToString(), y.GetType().ToString())); 56 56 } … … 62 62 returnVal = DateTime.Compare(firstDate, secondDate); 63 63 } else { 64 // if neither compared object has a valid date format, compare as a string65 returnVal = String.Compare(listViewItemX.SubItems[col].Text, listViewItemY.SubItems[col].Text);64 throw new ArgumentException(string.Format("The ListViewItemDateComparer expects DateTimes. Can't parse {0} and {1}.", 65 listViewItemX.SubItems[col].Text, listViewItemY.SubItems[col].Text)); 66 66 } 67 67 -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r8708 r8718 44 44 this.itemsListView.FullRowSelect = true; 45 45 46 this.itemsListView.ListViewItemSorter = new ListViewItem Comparer(0, SortOrder.Ascending);46 this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending); 47 47 this.itemsListView.Sorting = SortOrder.Ascending; 48 48 this.itemsListView.Sort();
Note: See TracChangeset
for help on using the changeset viewer.