From e6be610a9da66f2e63fb2f8f75026d9187b6dd41 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 17 Jan 2022 02:34:41 -0500 Subject: [PATCH] rename UniversalEditor.UserInterface.MainWindow to EditorWindow to avoid naming conflict with MBS.Framework.MainWindow --- .../EditorApplication.cs | 14 +++--- .../EditorChangedEvent.cs | 4 +- .../EditorChangingEvent.cs | 4 +- .../EditorDocumentExplorer.cs | 6 +-- .../EditorPropertiesPanel.cs | 4 +- .../{MainWindow.cs => EditorWindow.cs} | 45 ++++++++----------- .../Pages/EditorPage.cs | 4 +- .../Pages/StartPage.cs | 2 +- .../Panels/PropertyListPanel.cs | 2 +- .../Panels/SolutionExplorerPanel.cs | 4 +- .../Panels/ToolboxPanel.cs | 2 +- .../UniversalEditor.UserInterface.csproj | 4 +- .../Plugins/Transport/TransportPlugin.cs | 10 ++--- 13 files changed, 50 insertions(+), 55 deletions(-) rename Libraries/UniversalEditor.UserInterface/{MainWindow.cs => EditorWindow.cs} (99%) diff --git a/Libraries/UniversalEditor.UserInterface/EditorApplication.cs b/Libraries/UniversalEditor.UserInterface/EditorApplication.cs index 67ed7407..59fb74ef 100644 --- a/Libraries/UniversalEditor.UserInterface/EditorApplication.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorApplication.cs @@ -56,7 +56,7 @@ namespace UniversalEditor.UserInterface { if (e.Key == KeyboardKey.Tab && (e.ModifierKeys & KeyboardModifierKey.Control) == KeyboardModifierKey.Control) { - MainWindow mw = (CurrentWindow as MainWindow); + EditorWindow mw = (CurrentWindow as EditorWindow); if (mw != null) { mw.SetWindowListVisible(true, false); @@ -73,7 +73,7 @@ namespace UniversalEditor.UserInterface { if (e.Key == KeyboardKey.LControlKey || e.Key == KeyboardKey.RControlKey) { - MainWindow mw = (CurrentWindow as MainWindow); + EditorWindow mw = (CurrentWindow as EditorWindow); if (mw != null) { mw.SetWindowListVisible(false, false); @@ -599,7 +599,7 @@ namespace UniversalEditor.UserInterface for (int i = 0; i < ((UIApplication)Application.Instance).Windows.Count; i++) { - MainWindow mw = (((UIApplication)Application.Instance).Windows[i] as MainWindow); + EditorWindow mw = (((UIApplication)Application.Instance).Windows[i] as EditorWindow); if (mw == null) continue; if (!mw.Close()) @@ -611,7 +611,7 @@ namespace UniversalEditor.UserInterface } /// - /// Creates an empty . Usually this is just a + /// Creates an empty . Usually this is just a /// call to , but it can be customized to present /// a blank document editor for your application's default document format. /// @@ -1224,7 +1224,7 @@ namespace UniversalEditor.UserInterface /// public void OpenWindow() { - MainWindow mw = new MainWindow(); + EditorWindow mw = new EditorWindow(); mw.Show(); } /// @@ -1233,7 +1233,7 @@ namespace UniversalEditor.UserInterface /// The file name(s) of the document(s) to load. public void OpenWindow(params string[] fileNames) { - MainWindow mw = new MainWindow(); + EditorWindow mw = new EditorWindow(); mw.Show(); mw.OpenFile(fileNames); @@ -1244,7 +1244,7 @@ namespace UniversalEditor.UserInterface /// The document model(s) of the document(s) to load. public void OpenWindow(params Document[] documents) { - MainWindow mw = new MainWindow(); + EditorWindow mw = new EditorWindow(); mw.Show(); mw.OpenFile(documents); diff --git a/Libraries/UniversalEditor.UserInterface/EditorChangedEvent.cs b/Libraries/UniversalEditor.UserInterface/EditorChangedEvent.cs index 72e6d55d..c90ade4d 100644 --- a/Libraries/UniversalEditor.UserInterface/EditorChangedEvent.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorChangedEvent.cs @@ -23,11 +23,11 @@ namespace UniversalEditor.UserInterface { public class EditorChangedEventArgs : EventArgs { - public MainWindow Window { get; } = null; + public EditorWindow Window { get; } = null; public Editor PreviousEditor { get; } = null; public Editor CurrentEditor { get; } = null; - public EditorChangedEventArgs(MainWindow window, Editor previousEditor, Editor currentEditor) + public EditorChangedEventArgs(EditorWindow window, Editor previousEditor, Editor currentEditor) { Window = window; PreviousEditor = previousEditor; diff --git a/Libraries/UniversalEditor.UserInterface/EditorChangingEvent.cs b/Libraries/UniversalEditor.UserInterface/EditorChangingEvent.cs index 4e9b839c..e60147a7 100644 --- a/Libraries/UniversalEditor.UserInterface/EditorChangingEvent.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorChangingEvent.cs @@ -25,11 +25,11 @@ namespace UniversalEditor.UserInterface { public class EditorChangingEventArgs : CancelEventArgs { - public MainWindow Window { get; } = null; + public EditorWindow Window { get; } = null; public Editor PreviousEditor { get; } = null; public Editor CurrentEditor { get; } = null; - public EditorChangingEventArgs(MainWindow window, Editor previousEditor, Editor currentEditor) + public EditorChangingEventArgs(EditorWindow window, Editor previousEditor, Editor currentEditor) { Window = window; PreviousEditor = previousEditor; diff --git a/Libraries/UniversalEditor.UserInterface/EditorDocumentExplorer.cs b/Libraries/UniversalEditor.UserInterface/EditorDocumentExplorer.cs index 03fc3798..0c1137f7 100644 --- a/Libraries/UniversalEditor.UserInterface/EditorDocumentExplorer.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorDocumentExplorer.cs @@ -40,7 +40,7 @@ namespace UniversalEditor.UserInterface { get { - ListViewControl lv = ((MainWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; + ListViewControl lv = ((EditorWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; if (lv.SelectedRows.Count > 0) { return lv.SelectedRows[0].GetExtraData("node"); @@ -52,7 +52,7 @@ namespace UniversalEditor.UserInterface TreeModelRow row = FindRow(value); if (row != null) { - ListViewControl lv = ((MainWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; + ListViewControl lv = ((EditorWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; lv.SelectedRows.Clear(); lv.SelectedRows.Add(row); @@ -63,7 +63,7 @@ namespace UniversalEditor.UserInterface private TreeModelRow FindRow(EditorDocumentExplorerNode node, TreeModelRow parent = null) { - ListViewControl lv = ((MainWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; + ListViewControl lv = ((EditorWindow)(Application.Instance as UIApplication).CurrentWindow).DocumentExplorerPanel.ListView; TreeModelRow.TreeModelRowCollection coll = lv.Model.Rows; if (parent != null) diff --git a/Libraries/UniversalEditor.UserInterface/EditorPropertiesPanel.cs b/Libraries/UniversalEditor.UserInterface/EditorPropertiesPanel.cs index 7fe1273e..d6f1a1ea 100644 --- a/Libraries/UniversalEditor.UserInterface/EditorPropertiesPanel.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorPropertiesPanel.cs @@ -41,9 +41,9 @@ namespace UniversalEditor.UserInterface { _SelectedObject = value; - if (Parent?.ParentWindow is MainWindow) + if (Parent?.ParentWindow is EditorWindow) { - ((PropertyListPanel)(Parent.ParentWindow as MainWindow).FindPanel(PropertyListPanel.ID)).SelectedObject = value; + ((PropertyListPanel)(Parent.ParentWindow as EditorWindow).FindPanel(PropertyListPanel.ID)).SelectedObject = value; } } } diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/EditorWindow.cs similarity index 99% rename from Libraries/UniversalEditor.UserInterface/MainWindow.cs rename to Libraries/UniversalEditor.UserInterface/EditorWindow.cs index 3702e0ab..dc07e3a1 100644 --- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/EditorWindow.cs @@ -1,43 +1,36 @@ using System; - -using UniversalEditor.Accessors; -using UniversalEditor.ObjectModels.Project; -using UniversalEditor.ObjectModels.Solution; -using UniversalEditor.ObjectModels.Text.Plain; - -using UniversalEditor.UserInterface.Dialogs; -using UniversalEditor.UserInterface.Panels; - +using System.Collections.Generic; +using System.Text; +using MBS.Framework; +using MBS.Framework.Drawing; using MBS.Framework.UserInterface; using MBS.Framework.UserInterface.Controls; using MBS.Framework.UserInterface.Controls.Docking; +using MBS.Framework.UserInterface.Controls.Ribbon; using MBS.Framework.UserInterface.Dialogs; using MBS.Framework.UserInterface.DragDrop; using MBS.Framework.UserInterface.Input.Keyboard; using MBS.Framework.UserInterface.Input.Mouse; -using MBS.Framework.UserInterface.Drawing; -using MBS.Framework.Drawing; - // TODO: We need to work on UWT signaling to native objects... using MBS.Framework.UserInterface.Layouts; -using MBS.Framework.UserInterface.Controls.Ribbon; -using UniversalEditor.Printing; using MBS.Framework.UserInterface.Printing; -using UniversalEditor.UserInterface.Pages; -using UniversalEditor.ObjectModels.Binary; + +using UniversalEditor.Accessors; using UniversalEditor.DataFormats.Binary; -using System.Collections.Generic; -using System.Text; -using MBS.Framework.UserInterface.Controls.ListView; -using MBS.Framework; -using UniversalEditor.UserInterface.Controls; +using UniversalEditor.ObjectModels.Binary; +using UniversalEditor.ObjectModels.Project; using UniversalEditor.ObjectModels.PropertyList; -using MBS.Framework.Collections; +using UniversalEditor.ObjectModels.Solution; +using UniversalEditor.Printing; +using UniversalEditor.UserInterface.Controls; +using UniversalEditor.UserInterface.Dialogs; +using UniversalEditor.UserInterface.Pages; +using UniversalEditor.UserInterface.Panels; namespace UniversalEditor.UserInterface { - public class MainWindow : MBS.Framework.UserInterface.MainWindow, IHostApplicationWindow + public class EditorWindow : MainWindow, IHostApplicationWindow { private DockingContainerControl dckContainer = null; @@ -147,7 +140,7 @@ namespace UniversalEditor.UserInterface ((UIApplication)Application.Instance).ExecuteCommand(cmd.ID); } - public MainWindow() + public EditorWindow() { Layout = new BoxLayout(Orientation.Vertical); this.IconName = "universal-editor"; @@ -1822,9 +1815,9 @@ namespace UniversalEditor.UserInterface } /// /// Gets the s (center-docked s) contained within all s in this - /// . + /// . /// - /// The s contained within all s in this . + /// The s contained within all s in this . public Page[] GetPages() { return GetPages(dckContainer); diff --git a/Libraries/UniversalEditor.UserInterface/Pages/EditorPage.cs b/Libraries/UniversalEditor.UserInterface/Pages/EditorPage.cs index b2cc7cd7..75e352a5 100644 --- a/Libraries/UniversalEditor.UserInterface/Pages/EditorPage.cs +++ b/Libraries/UniversalEditor.UserInterface/Pages/EditorPage.cs @@ -114,7 +114,7 @@ namespace UniversalEditor.UserInterface.Pages RefreshEditor(); } - public override string Title => MainWindow.GetDocumentTitle(Document); + public override string Title => EditorWindow.GetDocumentTitle(Document); private void RefreshEditor() { @@ -123,7 +123,7 @@ namespace UniversalEditor.UserInterface.Pages // pnlLoading.Enabled = true; // pnlLoading.Visible = true; - string title = MainWindow.GetDocumentTitle(Document); + string title = EditorWindow.GetDocumentTitle(Document); ObjectModel om = null; EditorReference[] reditors = new EditorReference[0]; diff --git a/Libraries/UniversalEditor.UserInterface/Pages/StartPage.cs b/Libraries/UniversalEditor.UserInterface/Pages/StartPage.cs index 616801b2..66b46033 100644 --- a/Libraries/UniversalEditor.UserInterface/Pages/StartPage.cs +++ b/Libraries/UniversalEditor.UserInterface/Pages/StartPage.cs @@ -92,7 +92,7 @@ namespace UniversalEditor.UserInterface.Panels string fileName = e.Row.GetExtraData("FileName"); if (fileName != null) { - (ParentWindow as MainWindow).OpenFile(fileName); + (ParentWindow as EditorWindow).OpenFile(fileName); } } } diff --git a/Libraries/UniversalEditor.UserInterface/Panels/PropertyListPanel.cs b/Libraries/UniversalEditor.UserInterface/Panels/PropertyListPanel.cs index 0130a5ff..f3ce2165 100644 --- a/Libraries/UniversalEditor.UserInterface/Panels/PropertyListPanel.cs +++ b/Libraries/UniversalEditor.UserInterface/Panels/PropertyListPanel.cs @@ -155,7 +155,7 @@ namespace UniversalEditor.UserInterface.Panels Objects.Clear(); - Editor editor = ((MainWindow)ParentWindow).GetCurrentEditor(); + Editor editor = ((EditorWindow)ParentWindow).GetCurrentEditor(); if (editor == null) return; foreach (PropertyPanelObject obj in editor.PropertiesPanel.Objects) diff --git a/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs b/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs index df7f6fdc..2ff009fe 100644 --- a/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs +++ b/Libraries/UniversalEditor.UserInterface/Panels/SolutionExplorerPanel.cs @@ -393,13 +393,13 @@ namespace UniversalEditor.UserInterface.Panels private void mnuContextSolutionAddNewProject_Click(object sender, EventArgs e) { - MainWindow mw = (((EditorApplication)Application.Instance).LastWindow as MainWindow); + EditorWindow mw = (((EditorApplication)Application.Instance).LastWindow as EditorWindow); if (mw == null) return; mw.NewProject(true); } private void mnuContextSolutionAddExistingProject_Click(object sender, EventArgs e) { - MainWindow mw = (((EditorApplication)Application.Instance).LastWindow as MainWindow); + EditorWindow mw = (((EditorApplication)Application.Instance).LastWindow as EditorWindow); if (mw == null) return; ProjectObjectModel proj = mw.ShowOpenProjectDialog(); diff --git a/Libraries/UniversalEditor.UserInterface/Panels/ToolboxPanel.cs b/Libraries/UniversalEditor.UserInterface/Panels/ToolboxPanel.cs index ce191eb8..66a4066d 100644 --- a/Libraries/UniversalEditor.UserInterface/Panels/ToolboxPanel.cs +++ b/Libraries/UniversalEditor.UserInterface/Panels/ToolboxPanel.cs @@ -65,7 +65,7 @@ namespace UniversalEditor.UserInterface.Panels void LvToolbox_RowActivated(object sender, ListViewRowActivatedEventArgs e) { - MainWindow mw = (MainWindow)ParentWindow; + EditorWindow mw = (EditorWindow)ParentWindow; Editor ed = mw.GetCurrentEditor(); if (ed != null) diff --git a/Libraries/UniversalEditor.UserInterface/UniversalEditor.UserInterface.csproj b/Libraries/UniversalEditor.UserInterface/UniversalEditor.UserInterface.csproj index e8f900c6..f096e467 100644 --- a/Libraries/UniversalEditor.UserInterface/UniversalEditor.UserInterface.csproj +++ b/Libraries/UniversalEditor.UserInterface/UniversalEditor.UserInterface.csproj @@ -28,6 +28,8 @@ true ..\..\UniversalEditor.snk + 4.0.2022.01 + false true @@ -69,7 +71,7 @@ - + diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Plugins/Transport/TransportPlugin.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Plugins/Transport/TransportPlugin.cs index 00174853..53f0c07c 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Plugins/Transport/TransportPlugin.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Plugins/Transport/TransportPlugin.cs @@ -102,7 +102,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Plugins.Transport private void Transport_End(object sender, EventArgs e) { - Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.MainWindow)?.GetCurrentEditor(); + Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.EditorWindow)?.GetCurrentEditor(); Type t = ed?.GetType(); System.Reflection.PropertyInfo piTransport = t?.GetProperty("Transport", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); MBS.Audio.ITransport transport = (piTransport?.GetValue(ed, null) as MBS.Audio.ITransport); @@ -117,7 +117,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Plugins.Transport private void Transport_Forward(object sender, EventArgs e) { - Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.MainWindow)?.GetCurrentEditor(); + Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.EditorWindow)?.GetCurrentEditor(); Type t = ed?.GetType(); System.Reflection.PropertyInfo piTransport = t?.GetProperty("Transport", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); MBS.Audio.ITransport transport = (piTransport?.GetValue(ed, null) as MBS.Audio.ITransport); @@ -132,7 +132,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Plugins.Transport private void Transport_Play(object sender, EventArgs e) { - Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.MainWindow)?.GetCurrentEditor(); + Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.EditorWindow)?.GetCurrentEditor(); Type t = ed?.GetType(); System.Reflection.PropertyInfo piTransport = t?.GetProperty("Transport", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); MBS.Audio.ITransport transport = (piTransport?.GetValue(ed, null) as MBS.Audio.ITransport); @@ -148,7 +148,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Plugins.Transport private void Transport_Back(object sender, EventArgs e) { - Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.MainWindow)?.GetCurrentEditor(); + Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.EditorWindow)?.GetCurrentEditor(); Type t = ed?.GetType(); System.Reflection.PropertyInfo piTransport = t?.GetProperty("Transport", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); MBS.Audio.ITransport transport = (piTransport?.GetValue(ed, null) as MBS.Audio.ITransport); @@ -164,7 +164,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Plugins.Transport private void Transport_Rewind(object sender, EventArgs e) { - Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.MainWindow)?.GetCurrentEditor(); + Editor ed = (((UIApplication)Application.Instance).CurrentWindow as UniversalEditor.UserInterface.EditorWindow)?.GetCurrentEditor(); Type t = ed?.GetType(); System.Reflection.PropertyInfo piTransport = t?.GetProperty("Transport", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); MBS.Audio.ITransport transport = (piTransport?.GetValue(ed, null) as MBS.Audio.ITransport);