expose the Editors and Documents in a given UE MainWindow
This commit is contained in:
parent
9ef4d183e6
commit
97c9e605c4
@ -32,6 +32,15 @@ namespace UniversalEditor
|
||||
/// </summary>
|
||||
public class Document : IDisposable
|
||||
{
|
||||
public class ReadOnlyDocumentCollection : System.Collections.ObjectModel.ReadOnlyCollection<Document>
|
||||
{
|
||||
public ReadOnlyDocumentCollection(System.Collections.Generic.IList<Document> list)
|
||||
: base(list)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Accessor" /> which determines where the data is read from.
|
||||
/// </summary>
|
||||
|
||||
@ -36,6 +36,14 @@ namespace UniversalEditor.UserInterface
|
||||
/// </summary>
|
||||
public abstract class Editor : MBS.Framework.UserInterface.Container, IDocumentPropertiesProviderControl
|
||||
{
|
||||
public class ReadOnlyEditorCollection
|
||||
: System.Collections.ObjectModel.ReadOnlyCollection<Editor>
|
||||
{
|
||||
public ReadOnlyEditorCollection(IList<Editor> list) : base(list)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public EditorContext Context { get; private set; } = null;
|
||||
|
||||
private EditorDocumentExplorer _EditorDocumentExplorer = null;
|
||||
|
||||
@ -87,6 +87,9 @@ namespace UniversalEditor.UserInterface
|
||||
|
||||
ProjectObjectModel CurrentProject { get; set; }
|
||||
SolutionObjectModel CurrentSolution { get; set; }
|
||||
|
||||
Document.ReadOnlyDocumentCollection Documents { get; }
|
||||
Editor.ReadOnlyEditorCollection Editors { get; }
|
||||
}
|
||||
public class IHostApplicationWindowCollection
|
||||
: System.Collections.ObjectModel.Collection<IHostApplicationWindow>
|
||||
|
||||
@ -1457,6 +1457,42 @@ namespace UniversalEditor.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
public Document.ReadOnlyDocumentCollection Documents
|
||||
{
|
||||
get
|
||||
{
|
||||
// retrieve all documents currently loaded in this window
|
||||
EditorPage[] pages = GetEditorPages();
|
||||
List<Document> list = new List<Document>();
|
||||
for (int i = 0; i < pages.Length; i++)
|
||||
{
|
||||
list.Add(pages[i].Document);
|
||||
}
|
||||
return new Document.ReadOnlyDocumentCollection(list);
|
||||
}
|
||||
}
|
||||
|
||||
public Editor.ReadOnlyEditorCollection Editors
|
||||
{
|
||||
get
|
||||
{
|
||||
// retrieve all editors currently loaded in this window
|
||||
EditorPage[] pages = GetEditorPages();
|
||||
List<Editor> list = new List<Editor>();
|
||||
for (int i = 0; i < pages.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < pages[i].Controls.Count; j++)
|
||||
{
|
||||
if (pages[i].Controls[j] is Editor)
|
||||
{
|
||||
list.Add(pages[i].Controls[j] as Editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Editor.ReadOnlyEditorCollection(list);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public IDocumentPropertiesProvider FindDocumentPropertiesProvider(IControl control)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user