| | |
| | | |
| | | public void DeActiveHandler() |
| | | { |
| | | foreach (TabItem item in mainTab.tabControl.Items) |
| | | try |
| | | { |
| | | // 向主Control注册事件 |
| | | if (item.Content is IActiveDocChangeHandler handler) |
| | | if (mainTab?.tabControl != null) |
| | | { |
| | | ActiveDocChangeEvent -= handler.OnSwActiveDocChange; |
| | | ActiveDocSavedEvent -= handler.OnSwActiveDocSaved; |
| | | ActiveDocCustomPropertyChange -= handler.OnCustomPropertyChange; |
| | | DocDestroy -= handler.OnDocDestroy; |
| | | AfterDocDestroy -= handler.AfterDocDestroy; |
| | | foreach (TabItem item in mainTab.tabControl.Items) |
| | | { |
| | | // 向主Control注册事件 |
| | | if (item.Content is IActiveDocChangeHandler handler) |
| | | { |
| | | ActiveDocChangeEvent -= handler.OnSwActiveDocChange; |
| | | ActiveDocSavedEvent -= handler.OnSwActiveDocSaved; |
| | | ActiveDocCustomPropertyChange -= handler.OnCustomPropertyChange; |
| | | DocDestroy -= handler.OnDocDestroy; |
| | | AfterDocDestroy -= handler.AfterDocDestroy; |
| | | } |
| | | } |
| | | PluginInfos.Clear(); |
| | | } |
| | | } |
| | | PluginInfos.Clear(); |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("DeActiveHandler Failed.", ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |