|
|
|
@ -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() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|