Browse Source

References can now be removed. Rename/remove operations are now faster with really big projects

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@15 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 22 years ago
parent
commit
a283d8d061
  1. 9
      src/AddIns/Misc/AddinScout/Project/AddinScout.csproj
  2. 2
      src/AddIns/Misc/AddinScout/Project/AddinScout.csproj.user
  3. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj.user
  5. 11
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/CustomFolderNode.cs
  6. 13
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs
  7. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceFolder.cs
  8. 18
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceNode.cs
  9. 28
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

9
src/AddIns/Misc/AddinScout/Project/AddinScout.csproj

@ -1,10 +1,10 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project 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>
<ProductVersion>8.0.41115</ProductVersion> <ProductVersion>8.0.41115</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4B8F0F98-8BE1-402B-AA8B-C8D548577B38}</ProjectGuid> <ProjectGuid>{4b8f0f98-8be1-402b-aa8b-c8d548577b38}</ProjectGuid>
<RootNamespace>NewProject</RootNamespace> <RootNamespace>NewProject</RootNamespace>
<AssemblyName>AddinScout</AssemblyName> <AssemblyName>AddinScout</AssemblyName>
<OutputTarget>Library</OutputTarget> <OutputTarget>Library</OutputTarget>
@ -13,9 +13,6 @@
<NoConfig>False</NoConfig> <NoConfig>False</NoConfig>
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent> <RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<StartupObject />
<ApplicationIcon />
<Win32Resource />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
@ -63,8 +60,6 @@
<Name>ICSharpCode.SharpDevelop</Name> <Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Gui\" /> <Folder Include="Gui\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />

2
src/AddIns/Misc/AddinScout/Project/AddinScout.csproj.user

@ -1,4 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartProgram>..\..\..\..\..\bin\SharpDevelop.exe</StartProgram> <StartProgram>..\..\..\..\..\bin\SharpDevelop.exe</StartProgram>
</PropertyGroup> </PropertyGroup>

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

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project 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>

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj.user

@ -1,4 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " /> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " /> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<PropertyGroup> <PropertyGroup>

11
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/CustomFolderNode.cs

@ -38,10 +38,9 @@ namespace ICSharpCode.SharpDevelop.Project
public CustomFolderNode() public CustomFolderNode()
{ {
} }
public override void Refresh() protected void UpdateIcon()
{ {
base.Refresh();
if (Nodes.Count == 0) { if (Nodes.Count == 0) {
SetIcon(ClosedImage); SetIcon(ClosedImage);
} else if (IsExpanded) { } else if (IsExpanded) {
@ -49,6 +48,12 @@ namespace ICSharpCode.SharpDevelop.Project
} }
} }
public override void Refresh()
{
base.Refresh();
UpdateIcon();
}
public override void Expanding() public override void Expanding()
{ {
if (openedImage != null) { if (openedImage != null) {

13
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs

@ -152,12 +152,7 @@ namespace ICSharpCode.SharpDevelop.Project
return true; return true;
} }
} }
public override bool EnablePaste {
get {
return ((ExtTreeNode)Parent).EnablePaste;
}
}
public override void Delete() public override void Delete()
{ {
if (FileNodeStatus == FileNodeStatus.Missing) { if (FileNodeStatus == FileNodeStatus.Missing) {
@ -194,6 +189,12 @@ namespace ICSharpCode.SharpDevelop.Project
Clipboard.SetDataObject(new DataObject(typeof(FileNode).ToString(), new FileOperationClipboardObject(FileName, true)), true); Clipboard.SetDataObject(new DataObject(typeof(FileNode).ToString(), new FileOperationClipboardObject(FileName, true)), true);
} }
public override bool EnablePaste {
get {
return ((ExtTreeNode)Parent).EnablePaste;
}
}
public override void Paste() public override void Paste()
{ {
((ExtTreeNode)Parent).Paste(); ((ExtTreeNode)Parent).Paste();

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceFolder.cs

@ -38,7 +38,9 @@ namespace ICSharpCode.SharpDevelop.Project
referenceNode.AddTo(this); referenceNode.AddTo(this);
} }
} }
UpdateIcon();
} }
protected override void Initialize() protected override void Initialize()
{ {
ShowReferences(); ShowReferences();

18
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/ReferenceNode.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
namespace ICSharpCode.SharpDevelop.Project namespace ICSharpCode.SharpDevelop.Project
@ -23,6 +24,23 @@ namespace ICSharpCode.SharpDevelop.Project
Text = referenceProjectItem.Include; Text = referenceProjectItem.Include;
} }
#region Cut & Paste
public override bool EnableDelete {
get {
return true;
}
}
public override void Delete()
{
referenceProjectItem.Project.Items.Remove(referenceProjectItem);
Debug.Assert(Parent != null);
Debug.Assert(Parent is ReferenceFolder);
((ReferenceFolder)Parent).ShowReferences();
Project.Save();
}
#endregion
public override object AcceptVisitor(ProjectBrowserTreeNodeVisitor visitor, object data) public override object AcceptVisitor(ProjectBrowserTreeNodeVisitor visitor, object data)
{ {
return visitor.Visit(this, data); return visitor.Visit(this, data);

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

@ -37,7 +37,6 @@ namespace ICSharpCode.SharpDevelop.Project
static void FileServiceFileRenamed(object sender, FileRenameEventArgs e) static void FileServiceFileRenamed(object sender, FileRenameEventArgs e)
{ {
Console.WriteLine("File service file renamed.");
if (OpenSolution == null) { if (OpenSolution == null) {
return; return;
} }
@ -57,19 +56,19 @@ namespace ICSharpCode.SharpDevelop.Project
long y = 0; long y = 0;
foreach (IProject project in OpenSolution.Projects) { foreach (IProject project in OpenSolution.Projects) {
foreach (ProjectItem item in project.Items) { if (FileUtility.IsBaseDirectory(project.Directory, oldName)) {
++y; foreach (ProjectItem item in project.Items) {
if (FileUtility.IsBaseDirectory(oldName, item.FileName)) { ++y;
item.FileName = FileUtility.RenameBaseDirectory(item.FileName, oldName, newName); if (FileUtility.IsBaseDirectory(oldName, item.FileName)) {
item.FileName = FileUtility.RenameBaseDirectory(item.FileName, oldName, newName);
}
} }
} }
} }
Console.WriteLine("File service file renamed. DONE. {0} // {1}", x, y);
} }
static void FileServiceFileRemoved(object sender, FileEventArgs e) static void FileServiceFileRemoved(object sender, FileEventArgs e)
{ {
Console.WriteLine("File service file removed.");
if (OpenSolution == null) { if (OpenSolution == null) {
return; return;
} }
@ -87,16 +86,17 @@ namespace ICSharpCode.SharpDevelop.Project
} }
foreach (IProject project in OpenSolution.Projects) { foreach (IProject project in OpenSolution.Projects) {
for (int i = 0; i < project.Items.Count;) { if (FileUtility.IsBaseDirectory(project.Directory, fileName)) {
ProjectItem item =project.Items[i]; for (int i = 0; i < project.Items.Count;) {
if (FileUtility.IsBaseDirectory(fileName, item.FileName)) { ProjectItem item =project.Items[i];
project.Items.RemoveAt(i); if (FileUtility.IsBaseDirectory(fileName, item.FileName)) {
} else { project.Items.RemoveAt(i);
++i; } else {
++i;
}
} }
} }
} }
Console.WriteLine("File service file removed. DONE.");
} }
static void ActiveWindowChanged(object sender, EventArgs e) static void ActiveWindowChanged(object sender, EventArgs e)

Loading…
Cancel
Save