Browse Source

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
shortcuts
Daniel Grunwald 19 years ago
parent
commit
f3528c4d04
  1. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj
  2. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs
  3. 1
      src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj
  4. 1
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  5. 3
      src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
  6. 1
      src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj
  7. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj
  8. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs
  9. 6
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs
  10. 1
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj
  11. 1
      src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj
  12. 1
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj
  13. 1
      src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj
  14. 3
      src/AddIns/Misc/StartPage/Project/Src/Main.cs
  15. 4
      src/AddIns/Misc/StartPage/Project/StartPage.csproj
  16. 1
      src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj
  17. 1
      src/AddIns/Misc/UnitTesting/UnitTesting.csproj
  18. 3
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  19. 3
      src/Main/Base/Project/Src/Commands/FileCommands.cs
  20. 3
      src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs
  21. 3
      src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs
  22. 3
      src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs
  23. 3
      src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs
  24. 15
      src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs
  25. 2
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
  26. 2
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
  27. 3
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  28. 5
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs
  29. 5
      src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs
  30. 3
      src/Main/Base/Project/Src/Project/Items/ProjectItem.cs
  31. 13
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  32. 13
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs
  33. 4
      src/Main/Base/Project/Src/Project/MSBuildInternals.cs
  34. 5
      src/Main/Base/Project/Src/Project/Solution/Solution.cs
  35. 3
      src/Main/Base/Project/Src/Services/File/FileService.cs
  36. 9
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  37. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs
  38. 5
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs
  39. 37
      src/Main/Base/Project/Src/Util/ExtensionMethods.cs
  40. 184
      src/Main/Base/Project/Src/Util/Linq.cs
  41. 1
      src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj
  42. 5
      src/Main/Base/Test/NRefactoryResolverTests.cs
  43. 2
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj
  44. 21
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs
  45. 1
      src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj
  46. 3
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>Grunwald.BooBinding</RootNamespace> <RootNamespace>Grunwald.BooBinding</RootNamespace>
@ -15,6 +15,7 @@
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\BooBinding\</OutputPath> <OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\BooBinding\</OutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -33,6 +34,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/FormsDesignerBinding.cs

@ -7,6 +7,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using ICSharpCode.FormsDesigner; using ICSharpCode.FormsDesigner;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
@ -47,8 +48,7 @@ namespace Grunwald.BooBinding.Designer
public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) 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]; return new IViewContent[0];
} }

1
src/AddIns/BackendBindings/Boo/BooBinding/Test/BooBinding.Tests.csproj

@ -37,6 +37,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">

1
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -38,6 +38,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" /> <Reference Include="System.XML" />

3
src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs

@ -6,6 +6,7 @@
// </file> // </file>
using System; using System;
using System.Linq;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates; using ICSharpCode.SharpDevelop.Internal.Templates;
@ -156,7 +157,7 @@ namespace WixBinding.Tests.Project
MSBuild.BuildProperty GetMSBuildProperty(string name) MSBuild.BuildProperty GetMSBuildProperty(string name)
{ {
MSBuild.Project msbuildProject = project.MSBuildProject; MSBuild.Project msbuildProject = project.MSBuildProject;
foreach (MSBuild.BuildPropertyGroup g in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(msbuildProject.PropertyGroups))) { foreach (MSBuild.BuildPropertyGroup g in msbuildProject.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList()) {
if (!g.IsImported) { if (!g.IsImported) {
MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, name); MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, name);
if (property != null) { if (property != null) {

1
src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj

@ -35,6 +35,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />

4
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -21,6 +21,7 @@
<OutputPath>..\..\..\..\..\AddIns\AddIns\DisplayBindings\FormsDesigner\</OutputPath> <OutputPath>..\..\..\..\..\AddIns\AddIns\DisplayBindings\FormsDesigner\</OutputPath>
<BaseAddress>108003328</BaseAddress> <BaseAddress>108003328</BaseAddress>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -37,6 +38,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/CustomComponentsSideTab.cs

@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.Design; using System.ComponentModel.Design;
using System.Drawing.Design; using System.Drawing.Design;
using System.Linq;
using System.Reflection; using System.Reflection;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -67,7 +68,8 @@ namespace ICSharpCode.FormsDesigner.Gui
/// </summary> /// </summary>
static IEnumerable<IProjectContent> AllProjectContentsWithReferences { static IEnumerable<IProjectContent> AllProjectContentsWithReferences {
get { get {
return Linq.Distinct(Linq.Concat(ParserService.AllProjectContents, ParserService.DefaultProjectContentRegistry.GetLoadedProjectContents())); return Enumerable.Concat(ParserService.AllProjectContents, ParserService.DefaultProjectContentRegistry.GetLoadedProjectContents())
.Distinct();
} }
} }

6
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/SecondaryDisplayBinding.cs

@ -7,6 +7,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using ICSharpCode.NRefactory; using ICSharpCode.NRefactory;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
@ -109,10 +110,7 @@ namespace ICSharpCode.FormsDesigner
public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent)
{ {
if (Linq.Exists(viewContent.SecondaryViewContents, if (viewContent.SecondaryViewContents.Any(c => c is FormsDesignerViewContent)) {
delegate(IViewContent c) { return c is FormsDesignerViewContent; })
)
{
return new IViewContent[0]; return new IViewContent[0];
} }

1
src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj

@ -47,6 +47,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

1
src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj

@ -34,6 +34,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

1
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj

@ -40,6 +40,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="stdole"> <Reference Include="stdole">

1
src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj

@ -34,6 +34,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

3
src/AddIns/Misc/StartPage/Project/Src/Main.cs

@ -7,6 +7,7 @@
// project created on 16.07.2002 at 18:07 // project created on 16.07.2002 at 18:07
using System; using System;
using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding; using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
@ -25,7 +26,7 @@ namespace ICSharpCode.StartPage
isFirstStartPage = false; isFirstStartPage = false;
ProjectService.SolutionLoaded += delegate { ProjectService.SolutionLoaded += delegate {
// close all start pages when loading a solution // 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; BrowserPane b = v as BrowserPane;
if (b != null) { if (b != null) {
if (b.Url.Scheme == "startpage") { if (b.Url.Scheme == "startpage") {

4
src/AddIns/Misc/StartPage/Project/StartPage.csproj

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -18,6 +18,7 @@
<BaseAddress>126877696</BaseAddress> <BaseAddress>126877696</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -39,6 +40,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" /> <Reference Include="System.XML" />
</ItemGroup> </ItemGroup>

1
src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj

@ -25,6 +25,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

1
src/AddIns/Misc/UnitTesting/UnitTesting.csproj

@ -33,6 +33,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

3
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -41,6 +41,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
@ -696,7 +697,7 @@
<DependentUpon>AsynchronousWaitDialog.cs</DependentUpon> <DependentUpon>AsynchronousWaitDialog.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<Compile Include="Src\Gui\Dialogs\SharpDevelopColorDialog.cs" /> <Compile Include="Src\Gui\Dialogs\SharpDevelopColorDialog.cs" />
<Compile Include="Src\Util\Linq.cs" /> <Compile Include="Src\Util\ExtensionMethods.cs" />
<Compile Include="Src\Util\DebugTimer.cs" /> <Compile Include="Src\Util\DebugTimer.cs" />
<Compile Include="Src\Project\CustomTool.cs" /> <Compile Include="Src\Project\CustomTool.cs" />
<Compile Include="Src\Gui\Dialogs\SolutionConfiguration\EditAvailableConfigurationsDialog.Designer.cs"> <Compile Include="Src\Gui\Dialogs\SolutionConfiguration\EditAvailableConfigurationsDialog.Designer.cs">

3
src/Main/Base/Project/Src/Commands/FileCommands.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using System.Linq;
using System.Diagnostics; using System.Diagnostics;
using System.Windows.Forms; using System.Windows.Forms;
@ -69,7 +70,7 @@ namespace ICSharpCode.SharpDevelop.Commands
return; return;
} }
foreach (OpenedFile file in Linq.ToArray(content.Files)) { foreach (OpenedFile file in content.Files.ToArray()) {
Save(file); Save(file);
} }
} }

3
src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs

@ -7,6 +7,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -31,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Commands.TabStrip
public override void Run() public override void Run()
{ {
IWorkbenchWindow thisWindow = Owner as IWorkbenchWindow; 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 != thisWindow) {
if (!window.CloseWindow(false)) if (!window.CloseWindow(false))
break; break;

3
src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
@ -113,7 +114,7 @@ namespace ICSharpCode.SharpDevelop.Gui
panel.Controls.Add(userControl); panel.Controls.Add(userControl);
} }
} else { } else {
ShowError(Linq.First(errorList.Values).exception); ShowError(errorList.Values.First().exception);
} }
} }
} catch (Exception ex) { } catch (Exception ex) {

3
src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/AddNewConfigurationDialog.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -40,7 +41,7 @@ namespace ICSharpCode.SharpDevelop.Gui
okButton.Enabled = nameTextBox.TextLength > 0; okButton.Enabled = nameTextBox.TextLength > 0;
}; };
copyFromComboBox.Items.Add("<Empty>"); copyFromComboBox.Items.Add("<Empty>");
copyFromComboBox.Items.AddRange(Linq.ToArray(availableSourceItems)); copyFromComboBox.Items.AddRange(availableSourceItems.ToArray());
copyFromComboBox.SelectedIndex = 0; copyFromComboBox.SelectedIndex = 0;
if (solution) { if (solution) {

3
src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -79,7 +80,7 @@ namespace ICSharpCode.SharpDevelop.Gui
void ShowEntries(IEnumerable<string> list, string activeItem) void ShowEntries(IEnumerable<string> list, string activeItem)
{ {
string[] array = Linq.ToArray(list); string[] array = list.ToArray();
listBox.Items.Clear(); listBox.Items.Clear();
listBox.Items.AddRange(array); listBox.Items.AddRange(array);
if (listBox.Items.Count == 0) { if (listBox.Items.Count == 0) {

15
src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs

@ -9,6 +9,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Globalization; using System.Globalization;
@ -112,12 +113,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public IList<IWorkbenchWindow> WorkbenchWindowCollection { public IList<IWorkbenchWindow> WorkbenchWindowCollection {
get { get {
return Linq.ToArray(Linq.Distinct( return viewContentCollection.Select(vc => vc.WorkbenchWindow)
Linq.Select<IViewContent, IWorkbenchWindow>( .Distinct().ToArray().AsReadOnly();
viewContentCollection,
delegate (IViewContent vc) { return vc.WorkbenchWindow; }
)
));
} }
} }
@ -303,7 +300,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{ {
try { try {
closeAll = true; closeAll = true;
foreach (IWorkbenchWindow window in Linq.ToArray(this.WorkbenchWindowCollection)) { foreach (IWorkbenchWindow window in this.WorkbenchWindowCollection.ToArray()) {
window.CloseWindow(false); window.CloseWindow(false);
} }
} finally { } finally {
@ -459,9 +456,9 @@ namespace ICSharpCode.SharpDevelop.Gui
void CheckRemovedOrReplacedFile(object sender, FileEventArgs e) 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)) { 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); content.WorkbenchWindow.CloseWindow(true);
} }
} }

2
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

@ -579,7 +579,7 @@ namespace ICSharpCode.SharpDevelop.Gui
content.Control.Dock = DockStyle.Fill; content.Control.Dock = DockStyle.Fill;
SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(); SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow();
sdiWorkspaceWindow.ViewContents.Add(content); sdiWorkspaceWindow.ViewContents.Add(content);
Linq.Apply(content.SecondaryViewContents, sdiWorkspaceWindow.ViewContents.Add); content.SecondaryViewContents.Apply(sdiWorkspaceWindow.ViewContents.Add);
sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent); sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent);
if (dockPanel != null) { if (dockPanel != null) {
sdiWorkspaceWindow.Show(dockPanel); sdiWorkspaceWindow.Show(dockPanel);

2
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs

@ -333,7 +333,7 @@ namespace ICSharpCode.SharpDevelop.Gui
case DialogResult.Yes: case DialogResult.Yes:
if (ActiveViewContent.PrimaryFile != null) { if (ActiveViewContent.PrimaryFile != null) {
while (true) { while (true) {
Linq.Apply(ActiveViewContent.Files, ICSharpCode.SharpDevelop.Commands.SaveFile.Save); ActiveViewContent.Files.Apply(ICSharpCode.SharpDevelop.Commands.SaveFile.Save);
if (ActiveViewContent.IsDirty) { if (ActiveViewContent.IsDirty) {
if (MessageService.AskQuestion("${res:MainWindow.DiscardChangesMessage}")) { if (MessageService.AskQuestion("${res:MainWindow.DiscardChangesMessage}")) {

3
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
@ -98,7 +99,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
static IEnumerable<XmlElement> ChildElements(XmlElement parentElement) static IEnumerable<XmlElement> ChildElements(XmlElement parentElement)
{ {
return Linq.OfType<XmlElement>(parentElement.ChildNodes); return parentElement.ChildNodes.OfType<XmlElement>();
} }
void LoadElement(XmlElement node, string hintPath) void LoadElement(XmlElement node, string hintPath)

5
src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Drawing; using System.Drawing;
using System.Globalization; using System.Globalization;
using System.Windows.Forms; using System.Windows.Forms;
@ -638,11 +639,11 @@ namespace ICSharpCode.SharpDevelop.Project
{ {
List<string> items; List<string> items;
configurationComboBox.Items.Clear(); configurationComboBox.Items.Clear();
items = Linq.ToList(helper.Project.ConfigurationNames); items = helper.Project.ConfigurationNames.ToList();
items.Sort(); items.Sort();
configurationComboBox.Items.AddRange(items.ToArray()); configurationComboBox.Items.AddRange(items.ToArray());
platformComboBox.Items.Clear(); platformComboBox.Items.Clear();
items = Linq.ToList(helper.Project.PlatformNames); items = helper.Project.PlatformNames.ToList();
items.Sort(); items.Sort();
platformComboBox.Items.AddRange(items.ToArray()); platformComboBox.Items.AddRange(items.ToArray());
ResetIndex(); ResetIndex();

5
src/Main/Base/Project/Src/Project/Items/FileProjectItem.cs

@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing.Design; using System.Drawing.Design;
using System.Linq;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.Design; using System.Windows.Forms.Design;
@ -74,9 +75,7 @@ namespace ICSharpCode.SharpDevelop.Project
static IEnumerable<string> GetNames(IEnumerable<ItemType> itemTypes) static IEnumerable<string> GetNames(IEnumerable<ItemType> itemTypes)
{ {
return Linq.Select<ItemType, string>( return itemTypes.Select(it => it.ItemName);
itemTypes, delegate(ItemType it) { return it.ItemName; }
);
} }
} }

3
src/Main/Base/Project/Src/Project/Items/ProjectItem.cs

@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
@ -301,7 +302,7 @@ namespace ICSharpCode.SharpDevelop.Project
if (buildItem != null) if (buildItem != null)
return MSBuildInternals.GetCustomMetadataNames(buildItem); return MSBuildInternals.GetCustomMetadataNames(buildItem);
else else
return Linq.ToArray(virtualMetadata.Keys); return virtualMetadata.Keys.ToArray();
} }
} }
} }

13
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.IO; using System.IO;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -309,10 +310,10 @@ namespace ICSharpCode.SharpDevelop.Project
if (string.IsNullOrEmpty(configuration)) configuration = ActiveConfiguration; if (string.IsNullOrEmpty(configuration)) configuration = ActiveConfiguration;
if (string.IsNullOrEmpty(platform)) platform = ActivePlatform; 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. // of property groups.
foreach (MSBuild.BuildPropertyGroup g foreach (MSBuild.BuildPropertyGroup g
in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(project.PropertyGroups))) in project.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList())
{ {
if (g.IsImported) { if (g.IsImported) {
continue; continue;
@ -1073,7 +1074,7 @@ namespace ICSharpCode.SharpDevelop.Project
bool copiedGroup = false; bool copiedGroup = false;
if (copyFrom != null) { if (copyFrom != null) {
foreach (MSBuild.BuildPropertyGroup g foreach (MSBuild.BuildPropertyGroup g
in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(project.PropertyGroups))) in project.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList())
{ {
if (g.IsImported) { if (g.IsImported) {
continue; continue;
@ -1103,7 +1104,7 @@ namespace ICSharpCode.SharpDevelop.Project
bool copiedGroup = false; bool copiedGroup = false;
if (copyFrom != null) { if (copyFrom != null) {
foreach (MSBuild.BuildPropertyGroup g foreach (MSBuild.BuildPropertyGroup g
in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(project.PropertyGroups))) in project.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList())
{ {
if (g.IsImported) { if (g.IsImported) {
continue; continue;
@ -1153,7 +1154,7 @@ namespace ICSharpCode.SharpDevelop.Project
throw new InvalidOperationException("cannot remove the last configuration"); throw new InvalidOperationException("cannot remove the last configuration");
} }
foreach (MSBuild.BuildPropertyGroup g foreach (MSBuild.BuildPropertyGroup g
in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(project.PropertyGroups))) in project.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList())
{ {
if (g.IsImported) { if (g.IsImported) {
continue; continue;
@ -1191,7 +1192,7 @@ namespace ICSharpCode.SharpDevelop.Project
throw new InvalidOperationException("cannot remove the last platform"); throw new InvalidOperationException("cannot remove the last platform");
} }
foreach (MSBuild.BuildPropertyGroup g foreach (MSBuild.BuildPropertyGroup g
in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(project.PropertyGroups))) in project.PropertyGroups.Cast<MSBuild.BuildPropertyGroup>().ToList())
{ {
if (g.IsImported) { if (g.IsImported) {
continue; continue;

13
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
@ -215,10 +216,8 @@ namespace ICSharpCode.SharpDevelop.Project
else else
projectsToBuildWithoutDependencies = GetAllReferencedProjects(project); projectsToBuildWithoutDependencies = GetAllReferencedProjects(project);
projectsToBuild = Linq.ToList(Linq.Select<IProject, ProjectToBuild>( projectsToBuild = (from p in projectsToBuildWithoutDependencies
projectsToBuildWithoutDependencies, select new ProjectToBuild(p.FileName, options.Target.TargetName)).ToList();
p => new ProjectToBuild(p.FileName, options.Target.TargetName)
));
Dictionary<string, ProjectToBuild> projectDict = new Dictionary<string, ProjectToBuild>(StringComparer.InvariantCultureIgnoreCase); Dictionary<string, ProjectToBuild> projectDict = new Dictionary<string, ProjectToBuild>(StringComparer.InvariantCultureIgnoreCase);
foreach (ProjectToBuild ptb in projectsToBuild) { foreach (ProjectToBuild ptb in projectsToBuild) {
@ -240,7 +239,11 @@ namespace ICSharpCode.SharpDevelop.Project
ptb.configuration = item.GetEvaluatedMetadata("Configuration"); ptb.configuration = item.GetEvaluatedMetadata("Configuration");
ptb.platform = item.GetEvaluatedMetadata("Platform"); ptb.platform = item.GetEvaluatedMetadata("Platform");
} else { } 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)");
}
} }
} }
} }

4
src/Main/Base/Project/Src/Project/MSBuildInternals.cs

@ -9,6 +9,7 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Xml; using System.Xml;
using System.Text; using System.Text;
using System.Globalization; using System.Globalization;
@ -214,8 +215,7 @@ namespace ICSharpCode.SharpDevelop.Project
public static MSBuild.BuildProperty GetProperty(MSBuild.BuildPropertyGroup pg, string name) public static MSBuild.BuildProperty GetProperty(MSBuild.BuildPropertyGroup pg, string name)
{ {
return Linq.Find(Linq.CastTo<MSBuild.BuildProperty>(pg), return pg.Cast<MSBuild.BuildProperty>().FirstOrDefault(p => p.Name == name);
delegate(MSBuild.BuildProperty p) { return p.Name == name; });
} }
public static MSBuild.Engine CreateEngine() public static MSBuild.Engine CreateEngine()

5
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -942,8 +943,8 @@ namespace ICSharpCode.SharpDevelop.Project
projectConfiguration = matching.Configuration; projectConfiguration = matching.Configuration;
projectPlatform = matching.Platform; projectPlatform = matching.Platform;
} else { } else {
projectConfiguration = Linq.ToArray(project.ConfigurationNames)[0]; projectConfiguration = project.ConfigurationNames.First();
projectPlatform = FixPlatformNameForSolution(Linq.ToArray(project.PlatformNames)[0]); projectPlatform = FixPlatformNameForSolution(project.PlatformNames.First());
} }
if (createInProjects) { if (createInProjects) {
ICollection<string> existingInProject = addPlatform ? project.PlatformNames : project.ConfigurationNames; ICollection<string> existingInProject = addPlatform ? project.PlatformNames : project.ConfigurationNames;

3
src/Main/Base/Project/Src/Services/File/FileService.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
@ -188,7 +189,7 @@ namespace ICSharpCode.SharpDevelop
{ {
WorkbenchSingleton.SafeThreadAsyncCall( WorkbenchSingleton.SafeThreadAsyncCall(
delegate { delegate {
foreach (IViewContent content in Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)) { foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) {
DisplayBindingService.AttachSubWindows(content, true); DisplayBindingService.AttachSubWindows(content, true);
} }
}); });

9
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -6,6 +6,7 @@
// </file> // </file>
using System; using System;
using System.Linq;
using System.IO; using System.IO;
using System.Text; using System.Text;
@ -161,7 +162,7 @@ namespace ICSharpCode.SharpDevelop.Project
if (FileUtility.IsBaseDirectory(project.Directory, fileName)) { if (FileUtility.IsBaseDirectory(project.Directory, fileName)) {
IProjectItemListProvider provider = project as IProjectItemListProvider; IProjectItemListProvider provider = project as IProjectItemListProvider;
if (provider != null) { if (provider != null) {
foreach (ProjectItem item in Linq.ToArray(provider.Items)) { foreach (ProjectItem item in provider.Items.ToArray()) {
if (FileUtility.IsBaseDirectory(fileName, item.FileName)) { if (FileUtility.IsBaseDirectory(fileName, item.FileName)) {
provider.RemoveProjectItem(item); provider.RemoveProjectItem(item);
OnProjectItemRemoved(new ProjectItemEventArgs(project, item)); OnProjectItemRemoved(new ProjectItemEventArgs(project, item));
@ -187,10 +188,8 @@ namespace ICSharpCode.SharpDevelop.Project
public static void AddProject(ISolutionFolderNode solutionFolderNode, IProject newProject) public static void AddProject(ISolutionFolderNode solutionFolderNode, IProject newProject)
{ {
if (Linq.Exists(solutionFolderNode.Solution.SolutionFolders, if (solutionFolderNode.Solution.SolutionFolders.Any(
delegate (ISolutionFolder folder) { folder => string.Equals(folder.IdGuid, newProject.IdGuid, StringComparison.OrdinalIgnoreCase)))
return string.Equals(folder.IdGuid, newProject.IdGuid, StringComparison.OrdinalIgnoreCase);
}))
{ {
LoggingService.Warn("ProjectService.AddProject: Duplicate IdGuid detected"); LoggingService.Warn("ProjectService.AddProject: Duplicate IdGuid detected");
newProject.IdGuid = Guid.NewGuid().ToString().ToUpperInvariant(); newProject.IdGuid = Guid.NewGuid().ToString().ToUpperInvariant();

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs

@ -141,7 +141,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
member = method; member = method;
imageIndex = ClassBrowserIconService.GetIcon(method); imageIndex = ClassBrowserIconService.GetIcon(method);
ambience = AmbienceService.CurrentAmbience; ambience = AmbienceService.CurrentAmbience;
ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList; ambience.ConversionFlags = ConversionFlags.None;
text = ambience.Convert(method); text = ambience.Convert(method);
ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; ambience.ConversionFlags = ConversionFlags.StandardConversionFlags;
description = ambience.Convert(method); description = ambience.Convert(method);

5
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/DocumentIterator/AllOpenDocumentIterator.cs

@ -6,6 +6,7 @@
// </file> // </file>
using System; using System;
using System.Linq;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
@ -39,7 +40,7 @@ namespace SearchAndReplace
{ {
GetCurIndex(); GetCurIndex();
if (curIndex >= 0) { if (curIndex >= 0) {
IViewContent viewContent = Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)[curIndex]; IViewContent viewContent = WorkbenchSingleton.Workbench.ViewContentCollection.ToList()[curIndex];
if (viewContent is ITextEditorControlProvider) { if (viewContent is ITextEditorControlProvider) {
return viewContent; return viewContent;
} }
@ -63,7 +64,7 @@ namespace SearchAndReplace
void GetCurIndex() void GetCurIndex()
{ {
IViewContent[] viewContentCollection = Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection); IViewContent[] viewContentCollection = WorkbenchSingleton.Workbench.ViewContentCollection.ToArray();
int viewCount = WorkbenchSingleton.Workbench.ViewContentCollection.Count; int viewCount = WorkbenchSingleton.Workbench.ViewContentCollection.Count;
if (curIndex == -1 || curIndex >= viewCount) { if (curIndex == -1 || curIndex >= viewCount) {
for (int i = 0; i < viewCount; ++i) { for (int i = 0; i < viewCount; ++i) {

37
src/Main/Base/Project/Src/Util/ExtensionMethods.cs

@ -0,0 +1,37 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop
{
/// <summary>
/// Extension methods used in SharpDevelop.
/// </summary>
public static class ExtensionMethods
{
/// <summary>
/// Applies an action to all elements in the input.
/// </summary>
public static void Apply<T>(this IEnumerable<T> input, Action<T> action)
{
if (input == null)
throw new ArgumentNullException("input");
foreach (T element in input) {
action(element);
}
}
public static ReadOnlyCollection<T> AsReadOnly<T>(this T[] arr)
{
return Array.AsReadOnly(arr);
}
}
}

184
src/Main/Base/Project/Src/Util/Linq.cs

@ -1,184 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop
{
/// <summary>
/// A set of methods that replicate some of the LINQ functionality.
/// </summary>
/// <remarks>
/// Will be removed when SharpDevelop is compiled with C# 3.0.
/// </remarks>
public static class Linq
{
/// <summary>
/// Applies a conversion function to all elements in the input.
/// </summary>
public static IEnumerable<S> Select<T, S>(IEnumerable<T> input, Converter<T, S> converter)
{
foreach (T element in input) {
yield return converter(element);
}
}
/// <summary>
/// Applies an action to all elements in the input.
/// </summary>
public static void Apply<T>(IEnumerable<T> input, Action<T> action)
{
foreach (T element in input) {
action(element);
}
}
/// <summary>
/// Returns only the elements in input for which filter is true.
/// </summary>
public static IEnumerable<T> Where<T>(IEnumerable<T> input, Predicate<T> filter)
{
foreach (T element in input) {
if (filter(element))
yield return element;
}
}
/// <summary>
/// Returns the elements of type T inside input by running
/// "if (element is T) yield return (T)element;" on each element.
/// </summary>
public static IEnumerable<T> OfType<T>(IEnumerable input)
{
foreach (object element in input) {
if (element is T)
yield return (T)element;
}
}
/// <summary>
/// Casts a non-generic enumeration into a generic enumeration.
/// </summary>
public static IEnumerable<T> CastTo<T>(IEnumerable input)
{
foreach (object element in input) {
yield return (T)element;
}
}
/// <summary>
/// Returns the first element in input for which filter is true.
/// Returns default(T) if no element matches the filter.
/// </summary>
public static T Find<T>(IEnumerable<T> input, Predicate<T> filter)
{
foreach (T element in input) {
if (filter(element))
return element;
}
return default(T);
}
/// <summary>
/// Gets if any element in the input matches the filter.
/// </summary>
public static bool Exists<T>(IEnumerable<T> input, Predicate<T> filter)
{
foreach (T element in input) {
if (filter(element))
return true;
}
return false;
}
/// <summary>
/// Returns the first element from <paramref name="input"/>.
/// </summary>
public static T First<T>(IEnumerable<T> 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<T> ToList<T>(IEnumerable<T> input)
{
return new List<T>(input);
}
public static T[] ToArray<T>(IEnumerable<T> input)
{
if (input is ICollection<T>) {
ICollection<T> c = (ICollection<T>)input;
T[] arr = new T[c.Count];
c.CopyTo(arr, 0);
return arr;
} else {
return new List<T>(input).ToArray();
}
}
public static int Count<T>(IEnumerable<T> input)
{
if (input is ICollection<T>) {
return ((ICollection<T>)input).Count;
}
int count = 0;
using (IEnumerator<T> e = input.GetEnumerator()) {
while (e.MoveNext())
count++;
}
return count;
}
/// <summary>
/// Concatenates the specified enumerables.
/// </summary>
public static IEnumerable<T> Concat<T>(IEnumerable<T> input1, IEnumerable<T> input2)
{
foreach (T element in input1) {
yield return element;
}
foreach (T element in input2) {
yield return element;
}
}
/// <summary>
/// Concatenates the specified enumerables.
/// </summary>
public static IEnumerable<T> Concat<T>(IEnumerable<IEnumerable<T>> inputs)
{
foreach (IEnumerable<T> input in inputs) {
foreach (T element in input) {
yield return element;
}
}
}
/// <summary>
/// Outputs distinct elements only, filtering all duplicates.
/// </summary>
public static IEnumerable<T> Distinct<T>(IEnumerable<T> input)
{
// store elements already seen
Dictionary<T, object> elements = new Dictionary<T, object>();
foreach (T element in input) {
if (!elements.ContainsKey(element)) {
elements.Add(element, null);
yield return element;
}
}
}
}
}

1
src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj

@ -33,6 +33,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

5
src/Main/Base/Test/NRefactoryResolverTests.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Collections; using System.Collections;
using System.IO; using System.IO;
using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
@ -911,9 +912,7 @@ End Class
bool ContainsMember(IEnumerable input, string fullMemberName) bool ContainsMember(IEnumerable input, string fullMemberName)
{ {
return Linq.Exists(Linq.OfType<IMember>(input), delegate(IMember m) { return input.OfType<IMember>().Any(m => m.FullyQualifiedName == fullMemberName);
return m.FullyQualifiedName == fullMemberName;
});
} }
#endregion #endregion

2
src/Main/ICSharpCode.SharpDevelop.Dom/Project/ICSharpCode.SharpDevelop.Dom.csproj

@ -41,6 +41,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Mono.Cecil"> <Reference Include="Mono.Cecil">
<HintPath>..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath> <HintPath>..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath>
@ -144,7 +145,6 @@
<Compile Include="Src\FusionNative.cs" /> <Compile Include="Src\FusionNative.cs" />
<Compile Include="Src\DiffUtility.cs" /> <Compile Include="Src\DiffUtility.cs" />
<Compile Include="Src\ProjectContent\ParseInformation.cs" /> <Compile Include="Src\ProjectContent\ParseInformation.cs" />
<Compile Include="Src\Functional.cs" />
<Compile Include="Src\HostCallback.cs" /> <Compile Include="Src\HostCallback.cs" />
<Compile Include="Src\Refactoring\CodeGenerator.cs" /> <Compile Include="Src\Refactoring\CodeGenerator.cs" />
<Compile Include="Src\Refactoring\IDocument.cs" /> <Compile Include="Src\Refactoring\IDocument.cs" />

21
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Functional.cs

@ -1,21 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
namespace ICSharpCode.SharpDevelop
{
// define some delegates for functional programming
public delegate void Action();
// void Action<A>(A arg1) is already defined in System.
public delegate void Action<A, B>(A arg1, B arg2);
public delegate void Action<A, B, C>(A arg1, B arg2, C arg3);
public delegate R Func<R>();
public delegate R Func<A, R>(A arg1);
public delegate R Func<A, B, R>(A arg1, B arg2);
public delegate R Func<A, B, C, R>(A arg1, B arg2, C arg3);
}

1
src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj

@ -47,6 +47,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />

3
src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs

@ -13,6 +13,7 @@ using System.IO;
using System.Reflection; using System.Reflection;
using System.Resources; using System.Resources;
using System.Threading; using System.Threading;
using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Commands; using ICSharpCode.SharpDevelop.Commands;
@ -223,7 +224,7 @@ namespace ICSharpCode.SharpDevelop.Sda
bool CloseWorkbenchInternal(bool force) bool CloseWorkbenchInternal(bool force)
{ {
if (force) { if (force) {
foreach (IViewContent vc in Linq.ToArray(WorkbenchSingleton.Workbench.ViewContentCollection)) { foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) {
vc.WorkbenchWindow.CloseWindow(true); vc.WorkbenchWindow.CloseWindow(true);
} }
} }

Loading…
Cancel
Save