expose the current project and solution as properties on IHostApplicationWindow (used by build system)
This commit is contained in:
parent
3d66a06827
commit
a2f874a728
@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using MBS.Framework.UserInterface;
|
||||
using MBS.Framework.UserInterface.Controls.Docking;
|
||||
using UniversalEditor.ObjectModels.Project;
|
||||
using UniversalEditor.ObjectModels.Solution;
|
||||
|
||||
namespace UniversalEditor.UserInterface
|
||||
{
|
||||
@ -82,6 +84,9 @@ namespace UniversalEditor.UserInterface
|
||||
void SetWindowListVisible(bool visible, bool modal);
|
||||
|
||||
StatusBar StatusBar { get; }
|
||||
|
||||
ProjectObjectModel CurrentProject { get; set; }
|
||||
SolutionObjectModel CurrentSolution { get; set; }
|
||||
}
|
||||
public class IHostApplicationWindowCollection
|
||||
: System.Collections.ObjectModel.Collection<IHostApplicationWindow>
|
||||
|
||||
@ -1412,8 +1412,21 @@ namespace UniversalEditor.UserInterface
|
||||
pnlSolutionExplorer.Solution = value;
|
||||
}
|
||||
}
|
||||
public ProjectObjectModel CurrentProject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (pnlSolutionExplorer.Project != null)
|
||||
return pnlSolutionExplorer.Project;
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
pnlSolutionExplorer.Project = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
public void ShowDocumentPropertiesDialog()
|
||||
{
|
||||
|
||||
@ -46,6 +46,40 @@ namespace UniversalEditor.UserInterface.Panels
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectObjectModel Project
|
||||
{
|
||||
get
|
||||
{
|
||||
if (tvSolutionExplorer.SelectedRows.Count > 0)
|
||||
{
|
||||
TreeModelRow row = tvSolutionExplorer.SelectedRows[0];
|
||||
while (row != null)
|
||||
{
|
||||
ProjectObjectModel proj = row.GetExtraData<ProjectObjectModel>("project");
|
||||
if (proj != null)
|
||||
return proj;
|
||||
|
||||
row = row.ParentRow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Solution != null)
|
||||
{
|
||||
if (Solution.Projects.Count > 0)
|
||||
{
|
||||
return Solution.Projects[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private TreeModelRow LoadSolutionExplorerFolder(ObjectModels.Project.ProjectFolder fold)
|
||||
{
|
||||
TreeModelRow rowFolder = new TreeModelRow(new TreeModelRowColumn[]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user