public void Dispose() { // Remove the on mouse over event mAntennaFragment.onMouseOverListEntry -= showTargetInfo; GameEvents.onPlanetariumTargetChanged.Remove(OnChangeTarget); GameEvents.onHideUI.Remove(OnHideUI); GameEvents.onShowUI.Remove(OnShowUI); MapView.OnEnterMapView -= OnEnterMapView; MapView.OnExitMapView -= OnExitMapView; mSatelliteFragment.Dispose(); mAntennaFragment.Dispose(); }
public override void Hide() { // also hide the target info popup hideTargetInfo(); if (mAntennaFragment != null) { /// Remove callbacks from the onPositionChanged on the AbstractWindow onPositionChanged -= mTargetInfos.CalculatePosition; /// Remove the showTargetInfo callback from the on mouse over/out event mAntennaFragment.onMouseOverListEntry -= showTargetInfo; mAntennaFragment.onMouseOutListEntry -= hideTargetInfo; mAntennaFragment.Dispose(); mAntennaFragment = null; } GameEvents.onVesselChange.Remove(OnVesselChange); base.Hide(); }