From f3528c4d048df8ba051f48b488a084923ba4721b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 4 Aug 2007 21:35:05 +0000 Subject: [PATCH] Remove skip-messages for projects not compiled when compiling only a single project using F9. Replace ICSharpCode.SharpDevelop.Func<...> with System.Func<...>; use System.Linq.Enumerable instead of the ICSharpCode.SharpDevelop.Linq helper class. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2628 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Boo/BooBinding/Project/BooBinding.csproj | 4 +- .../Src/Designer/FormsDesignerBinding.cs | 4 +- .../BooBinding/Test/BooBinding.Tests.csproj | 1 + .../Project/CSharpBinding.csproj | 1 + .../CreateNewWixProjectObjectTestFixture.cs | 3 +- .../WixBinding/Test/WixBinding.Tests.csproj | 1 + .../Project/FormsDesigner.csproj | 4 +- .../Src/Gui/CustomComponentsSideTab.cs | 4 +- .../Project/Src/SecondaryDisplayBinding.cs | 6 +- .../XmlEditor/Project/XmlEditor.csproj | 1 + .../CodeCoverage/Project/CodeCoverage.csproj | 1 + .../Misc/HtmlHelp2/Project/HtmlHelp2.csproj | 1 + .../Misc/MonoAddIn/Project/MonoAddIn.csproj | 1 + src/AddIns/Misc/StartPage/Project/Src/Main.cs | 3 +- .../Misc/StartPage/Project/StartPage.csproj | 4 +- .../Project/SubversionAddIn.csproj | 1 + .../Misc/UnitTesting/UnitTesting.csproj | 1 + .../Project/ICSharpCode.SharpDevelop.csproj | 3 +- .../Base/Project/Src/Commands/FileCommands.cs | 3 +- .../Src/Commands/FileTabStripCommands.cs | 3 +- .../AbstractViewContentHandlingLoadErrors.cs | 3 +- .../AddNewConfigurationDialog.cs | 3 +- .../EditAvailableConfigurationsDialog.cs | 3 +- .../Src/Gui/Workbench/DefaultWorkbench.cs | 15 +- .../Workbench/Layouts/SdiWorkspaceLayout.cs | 2 +- .../Workbench/Layouts/SdiWorkspaceWindow.cs | 2 +- .../Templates/Project/ProjectDescriptor.cs | 3 +- .../Src/Project/ConfigurationGuiHelper.cs | 5 +- .../Src/Project/Items/FileProjectItem.cs | 5 +- .../Project/Src/Project/Items/ProjectItem.cs | 3 +- .../Src/Project/MSBuildBasedProject.cs | 13 +- .../Base/Project/Src/Project/MSBuildEngine.cs | 13 +- .../Project/Src/Project/MSBuildInternals.cs | 4 +- .../Project/Src/Project/Solution/Solution.cs | 5 +- .../Project/Src/Services/File/FileService.cs | 3 +- .../Services/ProjectService/ProjectService.cs | 9 +- .../CompletionWindow/CodeCompletionData.cs | 2 +- .../AllOpenDocumentIterator.cs | 5 +- .../Base/Project/Src/Util/ExtensionMethods.cs | 37 ++++ src/Main/Base/Project/Src/Util/Linq.cs | 184 ------------------ .../ICSharpCode.SharpDevelop.Tests.csproj | 1 + src/Main/Base/Test/NRefactoryResolverTests.cs | 5 +- .../ICSharpCode.SharpDevelop.Dom.csproj | 2 +- .../Project/Src/Functional.cs | 21 -- .../ICSharpCode.SharpDevelop.Sda.csproj | 1 + .../Src/CallHelper.cs | 3 +- 46 files changed, 132 insertions(+), 270 deletions(-) create mode 100644 src/Main/Base/Project/Src/Util/ExtensionMethods.cs delete mode 100644 src/Main/Base/Project/Src/Util/Linq.cs delete mode 100644 src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj b/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj index bd9f0b5773..3a954708f5 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj @@ -1,4 +1,4 @@ - + Library Grunwald.BooBinding @@ -15,6 +15,7 @@ 4096 4 false + v3.5 ..\..\..\..\..\..\AddIns\AddIns\BackendBindings\BooBinding\ @@ -33,6 +34,7 @@ + diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs index 96a23f4314..112e085c14 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs @@ -7,6 +7,7 @@ using System; using System.IO; +using System.Linq; using ICSharpCode.FormsDesigner; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; @@ -47,8 +48,7 @@ namespace Grunwald.BooBinding.Designer public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) { - if (Linq.Exists(viewContent.SecondaryViewContents, delegate(IViewContent c) { return c is FormsDesignerViewContent; })) - { + if (viewContent.SecondaryViewContents.Any(c => c is FormsDesignerViewContent)) { return new IViewContent[0]; } diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj b/src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj index 4c75b4b706..fcec14b7cc 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj @@ -37,6 +37,7 @@ + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj index e19d552cf8..1d86bfef40 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj @@ -38,6 +38,7 @@ + diff --git a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs index b02bc3f436..fe2396f548 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs +++ b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs @@ -6,6 +6,7 @@ // using System; +using System.Linq; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Internal.Templates; @@ -156,7 +157,7 @@ namespace WixBinding.Tests.Project MSBuild.BuildProperty GetMSBuildProperty(string name) { MSBuild.Project msbuildProject = project.MSBuildProject; - foreach (MSBuild.BuildPropertyGroup g in Linq.ToList(Linq.CastTo(msbuildProject.PropertyGroups))) { + foreach (MSBuild.BuildPropertyGroup g in msbuildProject.PropertyGroups.Cast().ToList()) { if (!g.IsImported) { MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, name); if (property != null) { diff --git a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj index 53bdc67830..24760f7e49 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj @@ -35,6 +35,7 @@ + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj index 3f011c7b15..c207a0f5a9 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj @@ -1,4 +1,4 @@ - + Debug AnyCPU @@ -21,6 +21,7 @@ ..\..\..\..\..\AddIns\AddIns\DisplayBindings\FormsDesigner\ 108003328 4096 + v3.5 True @@ -37,6 +38,7 @@ + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs index 1bf594584b..9c576a98cc 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing.Design; +using System.Linq; using System.Reflection; using ICSharpCode.Core; @@ -67,7 +68,8 @@ namespace ICSharpCode.FormsDesigner.Gui /// static IEnumerable AllProjectContentsWithReferences { get { - return Linq.Distinct(Linq.Concat(ParserService.AllProjectContents, ParserService.DefaultProjectContentRegistry.GetLoadedProjectContents())); + return Enumerable.Concat(ParserService.AllProjectContents, ParserService.DefaultProjectContentRegistry.GetLoadedProjectContents()) + .Distinct(); } } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs index 2c558bbd78..79f795e051 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs @@ -7,6 +7,7 @@ using System; using System.IO; +using System.Linq; using ICSharpCode.NRefactory; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; @@ -109,10 +110,7 @@ namespace ICSharpCode.FormsDesigner public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) { - if (Linq.Exists(viewContent.SecondaryViewContents, - delegate(IViewContent c) { return c is FormsDesignerViewContent; }) - ) - { + if (viewContent.SecondaryViewContents.Any(c => c is FormsDesignerViewContent)) { return new IViewContent[0]; } diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj index 6d4bb856e5..112fde059a 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj @@ -47,6 +47,7 @@ + diff --git a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj index 2d65ee098e..84e801b54a 100644 --- a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj +++ b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj @@ -34,6 +34,7 @@ + diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj index 625c10a4b6..d427eb73a1 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj +++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj @@ -40,6 +40,7 @@ + diff --git a/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj index 72c7dafdb2..4a2b76388b 100644 --- a/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj +++ b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj @@ -34,6 +34,7 @@ + diff --git a/src/AddIns/Misc/StartPage/Project/Src/Main.cs b/src/AddIns/Misc/StartPage/Project/Src/Main.cs index fe476c1cf5..2145860e4d 100644 --- a/src/AddIns/Misc/StartPage/Project/Src/Main.cs +++ b/src/AddIns/Misc/StartPage/Project/Src/Main.cs @@ -7,6 +7,7 @@ // project created on 16.07.2002 at 18:07 using System; +using System.Linq; using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.BrowserDisplayBinding; @@ -25,7 +26,7 @@ namespace ICSharpCode.StartPage isFirstStartPage = false; ProjectService.SolutionLoaded += delegate { // close all start pages when loading a solution - foreach (IViewContent v in Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)) { + foreach (IViewContent v in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) { BrowserPane b = v as BrowserPane; if (b != null) { if (b.Url.Scheme == "startpage") { diff --git a/src/AddIns/Misc/StartPage/Project/StartPage.csproj b/src/AddIns/Misc/StartPage/Project/StartPage.csproj index 53d566d134..f65bb63347 100644 --- a/src/AddIns/Misc/StartPage/Project/StartPage.csproj +++ b/src/AddIns/Misc/StartPage/Project/StartPage.csproj @@ -1,4 +1,4 @@ - + Debug AnyCPU @@ -18,6 +18,7 @@ 126877696 AnyCPU 4096 + v3.5 true @@ -39,6 +40,7 @@ + diff --git a/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj b/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj index 906d8164af..c88ea3e95f 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj +++ b/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj @@ -25,6 +25,7 @@ + diff --git a/src/AddIns/Misc/UnitTesting/UnitTesting.csproj b/src/AddIns/Misc/UnitTesting/UnitTesting.csproj index 65d58190a9..5fb778a391 100644 --- a/src/AddIns/Misc/UnitTesting/UnitTesting.csproj +++ b/src/AddIns/Misc/UnitTesting/UnitTesting.csproj @@ -33,6 +33,7 @@ + diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index b22f0f72d7..188d30c7e4 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -41,6 +41,7 @@ + @@ -696,7 +697,7 @@ AsynchronousWaitDialog.cs - + diff --git a/src/Main/Base/Project/Src/Commands/FileCommands.cs b/src/Main/Base/Project/Src/Commands/FileCommands.cs index 829f482652..b2a975b75d 100644 --- a/src/Main/Base/Project/Src/Commands/FileCommands.cs +++ b/src/Main/Base/Project/Src/Commands/FileCommands.cs @@ -8,6 +8,7 @@ using System; using System.Drawing.Printing; using System.IO; +using System.Linq; using System.Diagnostics; using System.Windows.Forms; @@ -69,7 +70,7 @@ namespace ICSharpCode.SharpDevelop.Commands return; } - foreach (OpenedFile file in Linq.ToArray(content.Files)) { + foreach (OpenedFile file in content.Files.ToArray()) { Save(file); } } diff --git a/src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs b/src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs index ebf370f254..3cef9c4779 100644 --- a/src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs +++ b/src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs @@ -7,6 +7,7 @@ using System; using System.IO; +using System.Linq; using System.Windows.Forms; using ICSharpCode.Core; @@ -31,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Commands.TabStrip public override void Run() { IWorkbenchWindow thisWindow = Owner as IWorkbenchWindow; - foreach (IWorkbenchWindow window in Linq.ToArray(WorkbenchSingleton.Workbench.WorkbenchWindowCollection)) { + foreach (IWorkbenchWindow window in WorkbenchSingleton.Workbench.WorkbenchWindowCollection.ToArray()) { if (window != thisWindow) { if (!window.CloseWindow(false)) break; diff --git a/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs b/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs index 86572daffc..ca4a64d89c 100644 --- a/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs +++ b/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using System.IO; using System.Windows.Forms; @@ -113,7 +114,7 @@ namespace ICSharpCode.SharpDevelop.Gui panel.Controls.Add(userControl); } } else { - ShowError(Linq.First(errorList.Values).exception); + ShowError(errorList.Values.First().exception); } } } catch (Exception ex) { diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs index ba2497cc3b..dab56c51c5 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using System.Windows.Forms; using ICSharpCode.Core; @@ -40,7 +41,7 @@ namespace ICSharpCode.SharpDevelop.Gui okButton.Enabled = nameTextBox.TextLength > 0; }; copyFromComboBox.Items.Add(""); - copyFromComboBox.Items.AddRange(Linq.ToArray(availableSourceItems)); + copyFromComboBox.Items.AddRange(availableSourceItems.ToArray()); copyFromComboBox.SelectedIndex = 0; if (solution) { diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs index 0cc1a6e125..799140bfce 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using System.Windows.Forms; using ICSharpCode.Core; @@ -79,7 +80,7 @@ namespace ICSharpCode.SharpDevelop.Gui void ShowEntries(IEnumerable list, string activeItem) { - string[] array = Linq.ToArray(list); + string[] array = list.ToArray(); listBox.Items.Clear(); listBox.Items.AddRange(array); if (listBox.Items.Count == 0) { diff --git a/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs b/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs index 19d3f25193..e721c40a1c 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs @@ -9,6 +9,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Diagnostics; using System.Drawing; using System.Globalization; @@ -112,12 +113,8 @@ namespace ICSharpCode.SharpDevelop.Gui public IList WorkbenchWindowCollection { get { - return Linq.ToArray(Linq.Distinct( - Linq.Select( - viewContentCollection, - delegate (IViewContent vc) { return vc.WorkbenchWindow; } - ) - )); + return viewContentCollection.Select(vc => vc.WorkbenchWindow) + .Distinct().ToArray().AsReadOnly(); } } @@ -303,7 +300,7 @@ namespace ICSharpCode.SharpDevelop.Gui { try { closeAll = true; - foreach (IWorkbenchWindow window in Linq.ToArray(this.WorkbenchWindowCollection)) { + foreach (IWorkbenchWindow window in this.WorkbenchWindowCollection.ToArray()) { window.CloseWindow(false); } } finally { @@ -459,9 +456,9 @@ namespace ICSharpCode.SharpDevelop.Gui void CheckRemovedOrReplacedFile(object sender, FileEventArgs e) { - foreach (OpenedFile file in Linq.ToArray(FileService.OpenedFiles)) { + foreach (OpenedFile file in FileService.OpenedFiles.ToArray()) { if (FileUtility.IsBaseDirectory(e.FileName, file.FileName)) { - foreach (IViewContent content in Linq.ToArray(file.RegisteredViewContents)) { + foreach (IViewContent content in file.RegisteredViewContents.ToArray()) { content.WorkbenchWindow.CloseWindow(true); } } diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs index 7ce415ff86..722279021b 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs @@ -579,7 +579,7 @@ namespace ICSharpCode.SharpDevelop.Gui content.Control.Dock = DockStyle.Fill; SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(); sdiWorkspaceWindow.ViewContents.Add(content); - Linq.Apply(content.SecondaryViewContents, sdiWorkspaceWindow.ViewContents.Add); + content.SecondaryViewContents.Apply(sdiWorkspaceWindow.ViewContents.Add); sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent); if (dockPanel != null) { sdiWorkspaceWindow.Show(dockPanel); diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs index fda21aab6c..a2111e8880 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs @@ -333,7 +333,7 @@ namespace ICSharpCode.SharpDevelop.Gui case DialogResult.Yes: if (ActiveViewContent.PrimaryFile != null) { while (true) { - Linq.Apply(ActiveViewContent.Files, ICSharpCode.SharpDevelop.Commands.SaveFile.Save); + ActiveViewContent.Files.Apply(ICSharpCode.SharpDevelop.Commands.SaveFile.Save); if (ActiveViewContent.IsDirty) { if (MessageService.AskQuestion("${res:MainWindow.DiscardChangesMessage}")) { diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs index c03245f91b..56e98d310d 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Xml; @@ -98,7 +99,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates static IEnumerable ChildElements(XmlElement parentElement) { - return Linq.OfType(parentElement.ChildNodes); + return parentElement.ChildNodes.OfType(); } void LoadElement(XmlElement node, string hintPath) diff --git a/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs b/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs index 689b9fd31b..a0ad16f10f 100644 --- a/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs +++ b/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Drawing; using System.Globalization; using System.Windows.Forms; @@ -638,11 +639,11 @@ namespace ICSharpCode.SharpDevelop.Project { List items; configurationComboBox.Items.Clear(); - items = Linq.ToList(helper.Project.ConfigurationNames); + items = helper.Project.ConfigurationNames.ToList(); items.Sort(); configurationComboBox.Items.AddRange(items.ToArray()); platformComboBox.Items.Clear(); - items = Linq.ToList(helper.Project.PlatformNames); + items = helper.Project.PlatformNames.ToList(); items.Sort(); platformComboBox.Items.AddRange(items.ToArray()); ResetIndex(); diff --git a/src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs b/src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs index d613bfd98a..5a65cddd1e 100644 --- a/src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs +++ b/src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing.Design; +using System.Linq; using System.IO; using System.Windows.Forms; using System.Windows.Forms.Design; @@ -74,9 +75,7 @@ namespace ICSharpCode.SharpDevelop.Project static IEnumerable GetNames(IEnumerable itemTypes) { - return Linq.Select( - itemTypes, delegate(ItemType it) { return it.ItemName; } - ); + return itemTypes.Select(it => it.ItemName); } } diff --git a/src/Main/Base/Project/Src/Project/Items/ProjectItem.cs b/src/Main/Base/Project/Src/Project/Items/ProjectItem.cs index 91328ab108..50f5a589a7 100644 --- a/src/Main/Base/Project/Src/Project/Items/ProjectItem.cs +++ b/src/Main/Base/Project/Src/Project/Items/ProjectItem.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; +using System.Linq; using System.IO; using System.Text; using System.Xml; @@ -301,7 +302,7 @@ namespace ICSharpCode.SharpDevelop.Project if (buildItem != null) return MSBuildInternals.GetCustomMetadataNames(buildItem); else - return Linq.ToArray(virtualMetadata.Keys); + return virtualMetadata.Keys.ToArray(); } } } diff --git a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs index 2b309805db..7a1a122983 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; +using System.Linq; using System.IO; using ICSharpCode.Core; @@ -309,10 +310,10 @@ namespace ICSharpCode.SharpDevelop.Project if (string.IsNullOrEmpty(configuration)) configuration = ActiveConfiguration; if (string.IsNullOrEmpty(platform)) platform = ActivePlatform; - // We need to use ToArray because EvaluateMSBuildCondition invalidates the list + // We need to use ToList because EvaluateMSBuildCondition invalidates the list // of property groups. foreach (MSBuild.BuildPropertyGroup g - in Linq.ToList(Linq.CastTo(project.PropertyGroups))) + in project.PropertyGroups.Cast().ToList()) { if (g.IsImported) { continue; @@ -1073,7 +1074,7 @@ namespace ICSharpCode.SharpDevelop.Project bool copiedGroup = false; if (copyFrom != null) { foreach (MSBuild.BuildPropertyGroup g - in Linq.ToList(Linq.CastTo(project.PropertyGroups))) + in project.PropertyGroups.Cast().ToList()) { if (g.IsImported) { continue; @@ -1103,7 +1104,7 @@ namespace ICSharpCode.SharpDevelop.Project bool copiedGroup = false; if (copyFrom != null) { foreach (MSBuild.BuildPropertyGroup g - in Linq.ToList(Linq.CastTo(project.PropertyGroups))) + in project.PropertyGroups.Cast().ToList()) { if (g.IsImported) { continue; @@ -1153,7 +1154,7 @@ namespace ICSharpCode.SharpDevelop.Project throw new InvalidOperationException("cannot remove the last configuration"); } foreach (MSBuild.BuildPropertyGroup g - in Linq.ToList(Linq.CastTo(project.PropertyGroups))) + in project.PropertyGroups.Cast().ToList()) { if (g.IsImported) { continue; @@ -1191,7 +1192,7 @@ namespace ICSharpCode.SharpDevelop.Project throw new InvalidOperationException("cannot remove the last platform"); } foreach (MSBuild.BuildPropertyGroup g - in Linq.ToList(Linq.CastTo(project.PropertyGroups))) + in project.PropertyGroups.Cast().ToList()) { if (g.IsImported) { continue; diff --git a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs index df728221b6..78476d2468 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; using System.Text.RegularExpressions; +using System.Linq; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; @@ -215,10 +216,8 @@ namespace ICSharpCode.SharpDevelop.Project else projectsToBuildWithoutDependencies = GetAllReferencedProjects(project); - projectsToBuild = Linq.ToList(Linq.Select( - projectsToBuildWithoutDependencies, - p => new ProjectToBuild(p.FileName, options.Target.TargetName) - )); + projectsToBuild = (from p in projectsToBuildWithoutDependencies + select new ProjectToBuild(p.FileName, options.Target.TargetName)).ToList(); Dictionary projectDict = new Dictionary(StringComparer.InvariantCultureIgnoreCase); foreach (ProjectToBuild ptb in projectsToBuild) { @@ -240,7 +239,11 @@ namespace ICSharpCode.SharpDevelop.Project ptb.configuration = item.GetEvaluatedMetadata("Configuration"); ptb.platform = item.GetEvaluatedMetadata("Platform"); } else { - parentEngine.MessageView.AppendLine("Cannot build project file: " + path + " (project is not loaded by SharpDevelop)"); + // don't warn when compiling a specific project, but simply ignore projects + // that are not required + if (project == null) { + parentEngine.MessageView.AppendLine("Cannot build project file: " + path + " (project is not loaded by SharpDevelop)"); + } } } } diff --git a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs index e01b4b1df0..9861b49cb1 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs @@ -9,6 +9,7 @@ using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Xml; using System.Text; using System.Globalization; @@ -214,8 +215,7 @@ namespace ICSharpCode.SharpDevelop.Project public static MSBuild.BuildProperty GetProperty(MSBuild.BuildPropertyGroup pg, string name) { - return Linq.Find(Linq.CastTo(pg), - delegate(MSBuild.BuildProperty p) { return p.Name == name; }); + return pg.Cast().FirstOrDefault(p => p.Name == name); } public static MSBuild.Engine CreateEngine() diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index 2d50d58e3b..3b61a992cd 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -942,8 +943,8 @@ namespace ICSharpCode.SharpDevelop.Project projectConfiguration = matching.Configuration; projectPlatform = matching.Platform; } else { - projectConfiguration = Linq.ToArray(project.ConfigurationNames)[0]; - projectPlatform = FixPlatformNameForSolution(Linq.ToArray(project.PlatformNames)[0]); + projectConfiguration = project.ConfigurationNames.First(); + projectPlatform = FixPlatformNameForSolution(project.PlatformNames.First()); } if (createInProjects) { ICollection existingInProject = addPlatform ? project.PlatformNames : project.ConfigurationNames; diff --git a/src/Main/Base/Project/Src/Services/File/FileService.cs b/src/Main/Base/Project/Src/Services/File/FileService.cs index dbb35996fc..b7917202ca 100644 --- a/src/Main/Base/Project/Src/Services/File/FileService.cs +++ b/src/Main/Base/Project/Src/Services/File/FileService.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.IO; using System.Windows.Forms; @@ -188,7 +189,7 @@ namespace ICSharpCode.SharpDevelop { WorkbenchSingleton.SafeThreadAsyncCall( delegate { - foreach (IViewContent content in Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)) { + foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) { DisplayBindingService.AttachSubWindows(content, true); } }); diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs index 681f857ad5..1920c346fe 100644 --- a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs +++ b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs @@ -6,6 +6,7 @@ // using System; +using System.Linq; using System.IO; using System.Text; @@ -161,7 +162,7 @@ namespace ICSharpCode.SharpDevelop.Project if (FileUtility.IsBaseDirectory(project.Directory, fileName)) { IProjectItemListProvider provider = project as IProjectItemListProvider; if (provider != null) { - foreach (ProjectItem item in Linq.ToArray(provider.Items)) { + foreach (ProjectItem item in provider.Items.ToArray()) { if (FileUtility.IsBaseDirectory(fileName, item.FileName)) { provider.RemoveProjectItem(item); OnProjectItemRemoved(new ProjectItemEventArgs(project, item)); @@ -187,10 +188,8 @@ namespace ICSharpCode.SharpDevelop.Project public static void AddProject(ISolutionFolderNode solutionFolderNode, IProject newProject) { - if (Linq.Exists(solutionFolderNode.Solution.SolutionFolders, - delegate (ISolutionFolder folder) { - return string.Equals(folder.IdGuid, newProject.IdGuid, StringComparison.OrdinalIgnoreCase); - })) + if (solutionFolderNode.Solution.SolutionFolders.Any( + folder => string.Equals(folder.IdGuid, newProject.IdGuid, StringComparison.OrdinalIgnoreCase))) { LoggingService.Warn("ProjectService.AddProject: Duplicate IdGuid detected"); newProject.IdGuid = Guid.NewGuid().ToString().ToUpperInvariant(); diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs index a36a166d9e..c16872297f 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs @@ -141,7 +141,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor member = method; imageIndex = ClassBrowserIconService.GetIcon(method); ambience = AmbienceService.CurrentAmbience; - ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList; + ambience.ConversionFlags = ConversionFlags.None; text = ambience.Convert(method); ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; description = ambience.Convert(method); diff --git a/src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs b/src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs index be8c99a1a3..a1c47fe74e 100644 --- a/src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs +++ b/src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs @@ -6,6 +6,7 @@ // using System; +using System.Linq; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Gui; @@ -39,7 +40,7 @@ namespace SearchAndReplace { GetCurIndex(); if (curIndex >= 0) { - IViewContent viewContent = Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)[curIndex]; + IViewContent viewContent = WorkbenchSingleton.Workbench.ViewContentCollection.ToList()[curIndex]; if (viewContent is ITextEditorControlProvider) { return viewContent; } @@ -63,7 +64,7 @@ namespace SearchAndReplace void GetCurIndex() { - IViewContent[] viewContentCollection = Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection); + IViewContent[] viewContentCollection = WorkbenchSingleton.Workbench.ViewContentCollection.ToArray(); int viewCount = WorkbenchSingleton.Workbench.ViewContentCollection.Count; if (curIndex == -1 || curIndex >= viewCount) { for (int i = 0; i < viewCount; ++i) { diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs new file mode 100644 index 0000000000..cebf78cfae --- /dev/null +++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs @@ -0,0 +1,37 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.Collections; +using System.Collections.ObjectModel; +using System.Collections.Generic; + +namespace ICSharpCode.SharpDevelop +{ + /// + /// Extension methods used in SharpDevelop. + /// + public static class ExtensionMethods + { + /// + /// Applies an action to all elements in the input. + /// + public static void Apply(this IEnumerable input, Action action) + { + if (input == null) + throw new ArgumentNullException("input"); + foreach (T element in input) { + action(element); + } + } + + public static ReadOnlyCollection AsReadOnly(this T[] arr) + { + return Array.AsReadOnly(arr); + } + } +} diff --git a/src/Main/Base/Project/Src/Util/Linq.cs b/src/Main/Base/Project/Src/Util/Linq.cs deleted file mode 100644 index 9fb9b2f61d..0000000000 --- a/src/Main/Base/Project/Src/Util/Linq.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// -// -// -// $Revision$ -// - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace ICSharpCode.SharpDevelop -{ - /// - /// A set of methods that replicate some of the LINQ functionality. - /// - /// - /// Will be removed when SharpDevelop is compiled with C# 3.0. - /// - public static class Linq - { - /// - /// Applies a conversion function to all elements in the input. - /// - public static IEnumerable Select(IEnumerable input, Converter converter) - { - foreach (T element in input) { - yield return converter(element); - } - } - - /// - /// Applies an action to all elements in the input. - /// - public static void Apply(IEnumerable input, Action action) - { - foreach (T element in input) { - action(element); - } - } - - /// - /// Returns only the elements in input for which filter is true. - /// - public static IEnumerable Where(IEnumerable input, Predicate filter) - { - foreach (T element in input) { - if (filter(element)) - yield return element; - } - } - - /// - /// Returns the elements of type T inside input by running - /// "if (element is T) yield return (T)element;" on each element. - /// - public static IEnumerable OfType(IEnumerable input) - { - foreach (object element in input) { - if (element is T) - yield return (T)element; - } - } - - /// - /// Casts a non-generic enumeration into a generic enumeration. - /// - public static IEnumerable CastTo(IEnumerable input) - { - foreach (object element in input) { - yield return (T)element; - } - } - - /// - /// Returns the first element in input for which filter is true. - /// Returns default(T) if no element matches the filter. - /// - public static T Find(IEnumerable input, Predicate filter) - { - foreach (T element in input) { - if (filter(element)) - return element; - } - return default(T); - } - - /// - /// Gets if any element in the input matches the filter. - /// - public static bool Exists(IEnumerable input, Predicate filter) - { - foreach (T element in input) { - if (filter(element)) - return true; - } - return false; - } - - /// - /// Returns the first element from . - /// - public static T First(IEnumerable input) - { - if (input == null) - throw new ArgumentNullException("input"); - foreach (T item in input) { - return item; - } - throw new ArgumentException("input must not be an empty collection", "input"); - } - - public static List ToList(IEnumerable input) - { - return new List(input); - } - - public static T[] ToArray(IEnumerable input) - { - if (input is ICollection) { - ICollection c = (ICollection)input; - T[] arr = new T[c.Count]; - c.CopyTo(arr, 0); - return arr; - } else { - return new List(input).ToArray(); - } - } - - public static int Count(IEnumerable input) - { - if (input is ICollection) { - return ((ICollection)input).Count; - } - int count = 0; - using (IEnumerator e = input.GetEnumerator()) { - while (e.MoveNext()) - count++; - } - return count; - } - - /// - /// Concatenates the specified enumerables. - /// - public static IEnumerable Concat(IEnumerable input1, IEnumerable input2) - { - foreach (T element in input1) { - yield return element; - } - foreach (T element in input2) { - yield return element; - } - } - - /// - /// Concatenates the specified enumerables. - /// - public static IEnumerable Concat(IEnumerable> inputs) - { - foreach (IEnumerable input in inputs) { - foreach (T element in input) { - yield return element; - } - } - } - - /// - /// Outputs distinct elements only, filtering all duplicates. - /// - public static IEnumerable Distinct(IEnumerable input) - { - // store elements already seen - Dictionary elements = new Dictionary(); - - foreach (T element in input) { - if (!elements.ContainsKey(element)) { - elements.Add(element, null); - yield return element; - } - } - } - } -} diff --git a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj index af75630af9..182980ff29 100644 --- a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj +++ b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj @@ -33,6 +33,7 @@ + diff --git a/src/Main/Base/Test/NRefactoryResolverTests.cs b/src/Main/Base/Test/NRefactoryResolverTests.cs index 6c1f43dc79..2d559e7b13 100644 --- a/src/Main/Base/Test/NRefactoryResolverTests.cs +++ b/src/Main/Base/Test/NRefactoryResolverTests.cs @@ -8,6 +8,7 @@ using System; using System.Collections; using System.IO; +using System.Linq; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Dom; @@ -911,9 +912,7 @@ End Class bool ContainsMember(IEnumerable input, string fullMemberName) { - return Linq.Exists(Linq.OfType(input), delegate(IMember m) { - return m.FullyQualifiedName == fullMemberName; - }); + return input.OfType().Any(m => m.FullyQualifiedName == fullMemberName); } #endregion diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj index 3b312fbf13..7f1def5db6 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj @@ -41,6 +41,7 @@ + ..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll @@ -144,7 +145,6 @@ - diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs deleted file mode 100644 index 556a1c6702..0000000000 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// -// -// -// $Revision$ -// - -using System; - -namespace ICSharpCode.SharpDevelop -{ - // define some delegates for functional programming - public delegate void Action(); - // void Action(A arg1) is already defined in System. - public delegate void Action(A arg1, B arg2); - public delegate void Action(A arg1, B arg2, C arg3); - public delegate R Func(); - public delegate R Func(A arg1); - public delegate R Func(A arg1, B arg2); - public delegate R Func(A arg1, B arg2, C arg3); -} diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj index fbfcc0155e..8dffb90d7b 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj @@ -47,6 +47,7 @@ + diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs index 179249cd9a..efea852d50 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs @@ -13,6 +13,7 @@ using System.IO; using System.Reflection; using System.Resources; using System.Threading; +using System.Linq; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Commands; @@ -223,7 +224,7 @@ namespace ICSharpCode.SharpDevelop.Sda bool CloseWorkbenchInternal(bool force) { if (force) { - foreach (IViewContent vc in Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)) { + foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) { vc.WorkbenchWindow.CloseWindow(true); } }