ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/xmltv_parser/ListViewSorter.cs
(Generate patch)

Comparing trunk/xmltv_parser/ListViewSorter.cs (file contents):
Revision 61 by william, Fri Mar 8 14:13:19 2013 UTC vs.
Revision 62 by william, Fri Mar 8 14:24:17 2013 UTC

# Line 8 | Line 8 | namespace xmltv_parser
8   {
9      public class ListViewSorter : System.Collections.IComparer
10      {
11 +        public ListViewSorter() { }
12          public int Compare(object o1, object o2)
13          {
14              if (!(o1 is ListViewItem))
# Line 16 | Line 17 | namespace xmltv_parser
17                  return (0);
18  
19              ListViewItem lvi1 = (ListViewItem)o2;
20 <            string str1 = lvi1.SubItems[ByColumn].Text;
20 >            string str1 = lvi1.SubItems[CurrentColumn].Text;
21              ListViewItem lvi2 = (ListViewItem)o1;
22 <            string str2 = lvi2.SubItems[ByColumn].Text;
22 >            string str2 = lvi2.SubItems[CurrentColumn].Text;
23  
24              int result;
25              if (lvi1.ListView.Sorting == SortOrder.Ascending)
# Line 26 | Line 27 | namespace xmltv_parser
27              else
28                  result = String.Compare(str2, str1);
29  
30 <            LastSort = ByColumn;
30 >            LastColumn = CurrentColumn;
31  
32              return (result);
33          }
34  
35 <
36 <        public int ByColumn
35 >        int _LastColumn;
36 >        public int LastColumn
37          {
38 <            get { return Column; }
39 <            set { Column = value; }
40 <        }
40 <        int Column = 0;
38 >            get { return _LastColumn; }
39 >            set { _LastColumn = value; }
40 >        }        
41  
42 <        public int LastSort
42 >        int _CurrentColumn = 0;
43 >        public int CurrentColumn
44          {
45 <            get { return LastColumn; }
46 <            set { LastColumn = value; }
45 >            get { return _CurrentColumn; }
46 >            set { _CurrentColumn = value; }
47          }
48 <        int LastColumn = 0;
48 >        
49      }
50   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines