diff --git a/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs b/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs index c1073102..9a254b13 100644 --- a/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs @@ -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 diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 871a5f12..6fa7f8e1 100644 --- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -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() { diff --git a/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs b/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs index 9a99eff5..73de2385 100644 --- a/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs +++ b/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs @@ -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("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[]