|
|
|
@ -6,7 +6,7 @@
@@ -6,7 +6,7 @@
|
|
|
|
|
// </file>
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Drawing; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Windows.Forms; |
|
|
|
@ -19,7 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -19,7 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
{ |
|
|
|
|
public class WordCountDialog : BaseSharpDevelopForm |
|
|
|
|
{ |
|
|
|
|
ArrayList items; |
|
|
|
|
List<Report> items; |
|
|
|
|
Report total; |
|
|
|
|
|
|
|
|
|
internal class Report |
|
|
|
@ -83,7 +83,7 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -83,7 +83,7 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
|
|
|
|
|
void startEvent(object sender, System.EventArgs e) |
|
|
|
|
{ |
|
|
|
|
items = new ArrayList(); |
|
|
|
|
items = new List<Report>(); |
|
|
|
|
total = null; |
|
|
|
|
|
|
|
|
|
switch (((ComboBox)ControlDictionary["locationComboBox"]).SelectedIndex) { |
|
|
|
@ -180,7 +180,7 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -180,7 +180,7 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
internal class ReportComparer : IComparer |
|
|
|
|
internal class ReportComparer : IComparer<Report> |
|
|
|
|
{ |
|
|
|
|
int sortKey; |
|
|
|
|
|
|
|
|
@ -189,22 +189,19 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -189,22 +189,19 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
sortKey = SortKey; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int Compare(object x, object y) |
|
|
|
|
public int Compare(Report x, Report y) |
|
|
|
|
{ |
|
|
|
|
Report xr = x as Report; |
|
|
|
|
Report yr = y as Report; |
|
|
|
|
|
|
|
|
|
if (x == null || y == null) return 1; |
|
|
|
|
|
|
|
|
|
switch (sortKey) { |
|
|
|
|
case 0: // files
|
|
|
|
|
return String.Compare(xr.name, yr.name); |
|
|
|
|
return String.Compare(x.name, y.name); |
|
|
|
|
case 1: // chars
|
|
|
|
|
return xr.chars.CompareTo(yr.chars); |
|
|
|
|
return x.chars.CompareTo(y.chars); |
|
|
|
|
case 2: // words
|
|
|
|
|
return xr.words.CompareTo(yr.words); |
|
|
|
|
return x.words.CompareTo(y.words); |
|
|
|
|
case 3: // lines
|
|
|
|
|
return xr.lines.CompareTo(yr.lines); |
|
|
|
|
return x.lines.CompareTo(y.lines); |
|
|
|
|
default: |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|