private int ColumnComparer(int columnIndex, ListViewItem x, ListViewItem y)
 {
     if (columnIndex == 2)
     {
         return(ComparerMethods.DescriptionComparer(x.SubItems[columnIndex].Text, y.SubItems[columnIndex].Text));
     }
     if (columnIndex == 1)
     {
         return(ComparerMethods.AdStatusComparer(x.SubItems[columnIndex].Text, y.SubItems[columnIndex].Text));
     }
     if (columnIndex == 6)
     {
         return
             (DateTime.Compare(((IMaintainable)x.Tag).ApproximateDate,
                               ((IMaintainable)y.Tag).ApproximateDate));
     }
     return(String.Compare(x.SubItems[columnIndex].Text, y.SubItems[columnIndex].Text));
 }
Beispiel #2
0
 private int ColumnComparer(int columnIndex, ListViewItem x, ListViewItem y)
 {
     if (columnIndex == 1)
     {
         if (string.Compare(x.SubItems[1].Text, y.SubItems[1].Text) == 0)
         {
             return(string.Compare(x.SubItems[4].Text, y.SubItems[4].Text));
         }
         else
         {
             return(string.Compare(x.SubItems[1].Text, y.SubItems[1].Text));
         }
     }
     if (columnIndex == 2)
     {
         return(ComparerMethods.DescriptionComparer(x.SubItems[columnIndex].Text, y.SubItems[columnIndex].Text));
     }
     return(string.Compare(x.SubItems[columnIndex].Text, y.SubItems[columnIndex].Text));
 }