private void _mainWidget_Destroyed(object sender, System.EventArgs e) { try { panel.RemoveNotification(OnPropertyNotified); variableEditor.StyleChanged -= OnStyleChanged; frequencyEditor.StyleChanged -= OnStyleChanged; variableEditor.MainWidget.Destroy(); variableEditor = null; frequencyEditor.MainWidget.Destroy(); frequencyEditor = null; dataStoreView1.MainWidget.Destroy(); dataStoreView1 = null; mainWidget.Destroyed -= _mainWidget_Destroyed; owner = null; } catch (Exception err) { ShowError(err); } }
private void _mainWidget_Destroyed(object sender, System.EventArgs e) { try { panel.RemoveNotification(OnPropertyNotified); variableEditor.StyleChanged -= OnStyleChanged; notebook1.SwitchPage -= OnSwitchPage; frequencyEditor.StyleChanged -= OnStyleChanged; groupByEdit.Dispose(); (variableEditor as ViewBase).Dispose(); variableEditor = null; (frequencyEditor as ViewBase).Dispose(); frequencyEditor = null; dataStoreView1.Dispose(); dataStoreView1 = null; mainWidget.Destroyed -= _mainWidget_Destroyed; owner = null; } catch (Exception err) { ShowError(err); } }