public static MapLegendForm GetInstance(MapLayersHandler mapLayersHandler) { if (_instance == null) { _instance = new MapLegendForm(mapLayersHandler); } return(_instance); }
private void OnFormClosed(object sender, FormClosedEventArgs e) { _instance = null; MapLayersHandler.LayerRemoved -= OnMapLayerRemoved; MapLayersHandler.MapRedrawNeeded -= OnMapRedrawNeeded; MapLayersHandler.LayerClassificationFinished -= OnLayerClassificationFinished; MapLayersHandler.OnLayerVisibilityChanged -= OnLayerVisibilityChanged; MapLayersHandler.LayerRefreshNeeded -= OnLayerRefreshNeeded; MapLayersHandler.LayerRead -= OnMapLayerRead; global.SaveFormSettings(this); }