Browse Source

Fixed forum-13577.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2105 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
8fdc73baba
  1. 2
      src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/ProjectNode.cs
  2. 8
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs
  3. 6
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

2
src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/ProjectNode.cs

@ -36,8 +36,6 @@ namespace ICSharpCode.SharpDevelop.Gui.ClassBrowser
public override void UpdateParseInformation(ICompilationUnit oldUnit, ICompilationUnit unit) public override void UpdateParseInformation(ICompilationUnit oldUnit, ICompilationUnit unit)
{ {
LoggingService.Debug("UpdateParseInformation: old=" + oldUnit + " new=" + unit);
Dictionary<string, IClass> classDictionary = new Dictionary<string, IClass>(); Dictionary<string, IClass> classDictionary = new Dictionary<string, IClass>();
Dictionary<string, bool> wasUpdatedDictionary = new Dictionary<string, bool>(); Dictionary<string, bool> wasUpdatedDictionary = new Dictionary<string, bool>();

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

@ -206,10 +206,16 @@ namespace ICSharpCode.SharpDevelop.Project
Project.Save(); Project.Save();
} }
} else if (!File.Exists(FileName)) { } else if (!File.Exists(FileName)) {
FileService.RemoveFile(FileName, false); // exclude this node, then remove it
Commands.ExcludeFileFromProject.ExcludeFileNode(this);
this.Remove();
Project.Save(); Project.Save();
} else if (MessageService.AskQuestion(GetQuestionText("${res:ProjectComponent.ContextMenu.Delete.Question}"))) { } else if (MessageService.AskQuestion(GetQuestionText("${res:ProjectComponent.ContextMenu.Delete.Question}"))) {
FileService.RemoveFile(FileName, false); FileService.RemoveFile(FileName, false);
if (IsLink) {
// we need to manually remove the link
Commands.ExcludeFileFromProject.ExcludeFileNode(this);
}
Project.Save(); Project.Save();
} }
} }

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

@ -220,6 +220,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary> /// <summary>
/// Removes a project item from the project, raising the ProjectItemRemoved event. /// Removes a project item from the project, raising the ProjectItemRemoved event.
/// Make sure you call project.Save() after removing items! /// Make sure you call project.Save() after removing items!
/// No action (not even raising the event) is taken when the item was already removed form the project.
/// </summary> /// </summary>
public static void RemoveProjectItem(IProject project, ProjectItem item) public static void RemoveProjectItem(IProject project, ProjectItem item)
{ {
@ -227,12 +228,11 @@ namespace ICSharpCode.SharpDevelop.Project
if (item == null) throw new ArgumentNullException("item"); if (item == null) throw new ArgumentNullException("item");
IProjectItemListProvider provider = project as IProjectItemListProvider; IProjectItemListProvider provider = project as IProjectItemListProvider;
if (provider != null) { if (provider != null) {
if (!provider.RemoveProjectItem(item)) { if (provider.RemoveProjectItem(item)) {
throw new ArgumentException("The item was not found in the project!");
}
OnProjectItemRemoved(new ProjectItemEventArgs(project, item)); OnProjectItemRemoved(new ProjectItemEventArgs(project, item));
} }
} }
}
static void BeforeLoadSolution() static void BeforeLoadSolution()
{ {

Loading…
Cancel
Save