You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.0 KiB
78 lines
2.0 KiB
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using System; |
|
using System.Collections.Generic; |
|
using ICSharpCode.SharpDevelop.Project; |
|
using ICSharpCode.PackageManagement; |
|
|
|
namespace ICSharpCode.PackageManagement.Design |
|
{ |
|
public class FakePackageManagementProjectService : IPackageManagementProjectService |
|
{ |
|
public bool IsRefreshProjectBrowserCalled; |
|
|
|
public IProject CurrentProject { get; set; } |
|
public Solution OpenSolution { get; set; } |
|
|
|
public event ProjectEventHandler ProjectAdded; |
|
public event SolutionFolderEventHandler SolutionFolderRemoved; |
|
public event EventHandler SolutionClosed; |
|
public event EventHandler<SolutionEventArgs> SolutionLoaded; |
|
|
|
public void RefreshProjectBrowser() |
|
{ |
|
IsRefreshProjectBrowserCalled = true; |
|
} |
|
|
|
public void FireProjectAddedEvent(IProject project) |
|
{ |
|
if (ProjectAdded != null) { |
|
ProjectAdded(this, new ProjectEventArgs(project)); |
|
} |
|
} |
|
|
|
public void FireSolutionClosedEvent() |
|
{ |
|
if (SolutionClosed != null) { |
|
SolutionClosed(this, new EventArgs()); |
|
} |
|
} |
|
|
|
public void FireSolutionLoadedEvent(Solution solution) |
|
{ |
|
if (SolutionLoaded != null) { |
|
SolutionLoaded(this, new SolutionEventArgs(solution)); |
|
} |
|
} |
|
|
|
public void FireSolutionFolderRemoved(ISolutionFolder solutionFolder) |
|
{ |
|
if (SolutionFolderRemoved != null) { |
|
SolutionFolderRemoved(this, new SolutionFolderEventArgs(solutionFolder)); |
|
} |
|
} |
|
|
|
public List<IProject> OpenProjects = new List<IProject>(); |
|
|
|
public void AddFakeProject(IProject project) |
|
{ |
|
OpenProjects.Add(project); |
|
} |
|
|
|
public IEnumerable<IProject> GetOpenProjects() |
|
{ |
|
return OpenProjects; |
|
} |
|
|
|
public void AddProjectItem(IProject project, ProjectItem item) |
|
{ |
|
ProjectService.AddProjectItem(project, item); |
|
} |
|
|
|
public void Save(IProject project) |
|
{ |
|
project.Save(); |
|
} |
|
} |
|
}
|
|
|