Fixing window management issues
This commit is contained in:
parent
21a8a80399
commit
0f2ab745ef
@ -378,7 +378,7 @@ namespace UniversalEditor.UserInterface.WindowsForms
|
||||
}
|
||||
}
|
||||
|
||||
public override void OpenWindow(params string[] FileNames)
|
||||
protected override IHostApplicationWindow OpenWindowInternal(params string[] FileNames)
|
||||
{
|
||||
MainWindow mw = new MainWindow();
|
||||
|
||||
@ -387,8 +387,7 @@ namespace UniversalEditor.UserInterface.WindowsForms
|
||||
mw.OpenFile(FileNames);
|
||||
}
|
||||
mw.Show();
|
||||
|
||||
Windows.Add(mw);
|
||||
return mw;
|
||||
}
|
||||
|
||||
public override void ExitApplication()
|
||||
|
||||
@ -259,15 +259,33 @@ namespace UniversalEditor.UserInterface
|
||||
|
||||
public void OpenFile(params string[] FileNames)
|
||||
{
|
||||
if (LastWindow == null)
|
||||
{
|
||||
OpenWindow(FileNames);
|
||||
return;
|
||||
}
|
||||
LastWindow.OpenFile(FileNames);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens a new window, optionally loading the specified documents.
|
||||
/// </summary>
|
||||
/// <param name="FileNames">The file name(s) of the document(s) to load.</param>
|
||||
public virtual void OpenWindow(params string[] FileNames)
|
||||
{
|
||||
/// <returns>An <see cref="IHostApplicationWindow"/> representing the window that was created.</returns>
|
||||
protected abstract IHostApplicationWindow OpenWindowInternal(params string[] FileNames);
|
||||
|
||||
/// <summary>
|
||||
/// Opens a new window, optionally loading the specified documents.
|
||||
/// </summary>
|
||||
/// <param name="FileNames">The file name(s) of the document(s) to load.</param>
|
||||
public void OpenWindow(params string[] FileNames)
|
||||
{
|
||||
IHostApplicationWindow window = OpenWindowInternal(FileNames);
|
||||
window.WindowClosed += delegate(object sender, EventArgs e)
|
||||
{
|
||||
mvarWindows.Remove(window);
|
||||
};
|
||||
mvarWindows.Add(window);
|
||||
}
|
||||
|
||||
// UniversalDataStorage.Editor.WindowsForms.Program
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user