优化模块资源释放与异步预加载
This commit is contained in:
@@ -338,17 +338,24 @@ namespace Lskj.Main
|
||||
int closeCount = 0;
|
||||
if (StaticControl.DogVerifyModuleForms.Count > 0)
|
||||
{
|
||||
foreach (DevExpress.XtraTab.XtraTabPage page in StaticControl.DogVerifyModuleForms)
|
||||
foreach (DevExpress.XtraTab.XtraTabPage page in
|
||||
new List<DevExpress.XtraTab.XtraTabPage>(StaticControl.DogVerifyModuleForms))
|
||||
{
|
||||
this.ActiveMainPanel.TabMain.Invoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
string moduleId = Convert.ToString(page.Tag);
|
||||
DllModule module;
|
||||
Manager.ModuleForms.TryGetValue(moduleId, out module);
|
||||
Manager.ModuleCloseSnapshot closeSnapshot =
|
||||
Manager.PrepareModuleClose(module, page);
|
||||
if (this.ActiveMainPanel.TabMain.TabPages.Contains(page))
|
||||
{
|
||||
this.ActiveMainPanel.TabMain.TabPages.Remove(page);
|
||||
page.Dispose();
|
||||
}
|
||||
Manager.ModuleForms.Remove(moduleId);
|
||||
Manager.CompleteModuleClose(closeSnapshot);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -360,7 +367,8 @@ namespace Lskj.Main
|
||||
}
|
||||
if (StaticControl.DogVerifyNoPageForms.Count > 0)
|
||||
{
|
||||
foreach (IForm iForm in StaticControl.DogVerifyNoPageForms)
|
||||
foreach (IForm iForm in
|
||||
new List<IForm>(StaticControl.DogVerifyNoPageForms))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -580,6 +588,7 @@ namespace Lskj.Main
|
||||
try
|
||||
{
|
||||
CloseWatermarkForm();
|
||||
Manager.CompleteAllModuleCloses();
|
||||
Manager.ModuleForms.Clear();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user