feat(legacy): add shell-independent module page compatibility

This commit is contained in:
2026-08-28 11:56:48 +08:00
parent 8472004711
commit 1c59fda8b8
8 changed files with 387 additions and 21 deletions
@@ -260,6 +260,16 @@ namespace Lskj.Main.Control
{
try
{
// Bind the real WinForms page surface before any menu or
// startup callback can open a module. The WPF host never
// constructs this panel; the explicit shell check keeps its
// ModulePageHost untouched if a shared AppDomain is used.
if (Manager.ExternalMainShell == null)
{
ERPInfo.Instance.ModulePageHost = null;
ERPInfo.Instance.PageControl = this.tabMain;
Manager.TabMain = this.tabMain;
}
WaitForm.ShowForm();
ContextMenuStrip headMenuStrip = new ContextMenuStrip();
@@ -366,7 +376,6 @@ namespace Lskj.Main.Control
new Thread(MainImpl.DnsHostEntry).Start();
this.mark_timer.Start();
ERPInfo.Instance.PageControl = this.tabMain;
ERPInfo.Instance.ModuleForms = Manager.ModuleForms;
if ((!this._allMenus.Columns.Contains("menuposition") || (!SystemInfo.Instance.IsOpenWork && !SystemInfo.Instance.ShowGallerysFromMenu)) && (!SystemInfo.Instance.HideGallerys || SystemInfo.Instance.DesktopFormatShowGallerys))
{
@@ -3850,12 +3859,12 @@ namespace Lskj.Main.Control
XtraTabPage beforePage = m.BeforePage;
if (beforePage != null)
{
foreach (XtraTabPage tablepage in ERPInfo.Instance.PageControl.TabPages)
foreach (XtraTabPage tablepage in ERPInfo.Instance.ModulePages)
{
if (tablepage == beforePage)
{
ERPInfo.Instance.PageControl.SelectedTabPage = beforePage;
ERPInfo.Instance.CurrentModulePage = beforePage;
if (isclose) tabPage.Dispose();
}
}
@@ -4945,6 +4954,7 @@ namespace Lskj.Main.Control
try
{
XtraTabPage tabPage = this.tabMain.SelectedTabPage;
ERPInfo.Instance.NotifyModulePageSelected(tabPage);
string guid = tabPage.Tag + "";
if (!string.IsNullOrWhiteSpace(guid) && Manager.ModuleForms.ContainsKey(guid))
{