From 7f5f7ceae807b21d3ef6c344f427f58ca39a81b1 Mon Sep 17 00:00:00 2001 From: Markus Palme Date: Fri, 27 Oct 2006 15:14:09 +0000 Subject: [PATCH] more arrays list replaced with generic lists git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1967 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../EventHandlerCompletitionDataProvider.cs | 6 +++--- .../Project/Src/Commands/FormsCommands.cs | 6 +++--- .../Src/Services/DesignerEventService.cs | 4 ++-- .../Src/Forms/RebuildRequiredEvents.cs | 7 +++---- .../Src/Gui/Dialogs/WordCountDialog.cs | 21 ++++++++----------- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs index 5fd2439816..52f03f21e7 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.Text; using ICSharpCode.Core; @@ -37,7 +37,7 @@ namespace CSharpBinding /// public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped) { - ArrayList completionData = new ArrayList(); + List completionData = new List(); completionData.Add(new DelegateCompletionData("new " + resolveResult.ResolvedType.Name + "();", 2, "delegate " + resolvedClass.FullyQualifiedName + "\n" + CodeCompletionData.GetDocumentation(resolvedClass.Documentation))); completionData.Add(new DelegateCompletionData("delegate { };", 3, @@ -95,7 +95,7 @@ namespace CSharpBinding } } } - return (ICompletionData[])completionData.ToArray(typeof(ICompletionData)); + return completionData.ToArray(); } private class DelegateCompletionData : DefaultCompletionData diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/FormsCommands.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/FormsCommands.cs index 1241c826e8..191fbb89ee 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/FormsCommands.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/FormsCommands.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.ComponentModel.Design; using System.Windows.Forms; using System.Windows.Forms.Design; @@ -98,7 +98,7 @@ namespace ICSharpCode.FormsDesigner.Commands { IMenuCommandService menuCommandService = (IMenuCommandService)owner; - ArrayList items = new ArrayList(); + List items = new List(); foreach (DesignerVerb verb in menuCommandService.Verbs) { items.Add(new ContextMenuCommand(verb)); @@ -109,7 +109,7 @@ namespace ICSharpCode.FormsDesigner.Commands items.Add(new MenuSeparator()); } - return (ToolStripItem[])items.ToArray(typeof(ToolStripItem)); + return items.ToArray(); } class ContextMenuCommand : ICSharpCode.Core.MenuCommand diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerEventService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerEventService.cs index ae93edf5b6..6d5f0f5da7 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerEventService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerEventService.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design; @@ -15,7 +15,7 @@ namespace ICSharpCode.FormsDesigner.Services public class DesignerEventService : IDesignerEventService { IDesignerHost activeDesigner = null; - ArrayList designers = new ArrayList(); + List designers = new List(); public void Reset() { diff --git a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/RebuildRequiredEvents.cs b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/RebuildRequiredEvents.cs index c83c327ec7..ced238e70e 100644 --- a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/RebuildRequiredEvents.cs +++ b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/RebuildRequiredEvents.cs @@ -6,11 +6,10 @@ // using System; -using System.Collections; +using System.Collections.Generic; namespace SharpServerTools.Forms { - /// /// An IRebuildable can be asked to rebuild its Node tree /// @@ -39,9 +38,9 @@ namespace SharpServerTools.Forms /// public class RebuildRequiredEventArgs: EventArgs { - ArrayList rebuildNodes = new ArrayList(); + List rebuildNodes = new List(); - public IEnumerable Nodes { + public IEnumerable Nodes { get { return rebuildNodes; } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs index 063e61765b..22fe4c83dc 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs @@ -6,7 +6,7 @@ // 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 { public class WordCountDialog : BaseSharpDevelopForm { - ArrayList items; + List items; Report total; internal class Report @@ -83,7 +83,7 @@ namespace ICSharpCode.SharpDevelop.Gui void startEvent(object sender, System.EventArgs e) { - items = new ArrayList(); + items = new List(); total = null; switch (((ComboBox)ControlDictionary["locationComboBox"]).SelectedIndex) { @@ -180,7 +180,7 @@ namespace ICSharpCode.SharpDevelop.Gui } - internal class ReportComparer : IComparer + internal class ReportComparer : IComparer { int sortKey; @@ -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; }