private void OnToolbarButtonClick(object sender, RoutedEventArgs e) { switch (((Button)sender).Name) { case "buttonAttributes": ShapeFileAttributesWindow sfw = ShapeFileAttributesWindow.GetInstance(MapWindowManager.MapInterActionHandler); if (sfw.Visibility == Visibility.Visible) { sfw.BringIntoView(); } else { sfw.Show(); sfw.Owner = this; sfw.ShapeFile = MapLayersHandler.CurrentMapLayer.LayerObject as Shapefile; sfw.ShowShapeFileAttribute(); } MapWindowManager.ShapeFileAttributesWindow = sfw; break; case "buttonRemove": break; case "buttonAdd": break; } }
public static ShapeFileAttributesWindow GetInstance(MapInterActionHandler mapInterActionHandler) { if (_instance == null) { _instance = new ShapeFileAttributesWindow(mapInterActionHandler); } return(_instance); }
private void OnWindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { CleanUp(); this.SavePlacement(); MapWindowManager.ShapeFileAttributesWindow = null; MapWindowManager.MapWindowForm.Focus(); _instance = null; }
private void CleanUp() { _instance = null; _mapInterActionHandler.ShapesSelected -= _mapInterActionHandler_ShapesSelected; _mapInterActionHandler.SelectionCleared -= _mapInterActionHandler_SelectionCleared; _mapInterActionHandler.MapLayersHandler.CurrentLayer -= MapLayersHandler_CurrentLayer; _mapInterActionHandler.MapLayersHandler.AllSelectionsCleared -= MapLayersHandler_AllSelectionsCleared; _mapInterActionHandler = null; }
private void OnWindowClosed(object sender, EventArgs e) { //CleanUp(); //this.SavePlacement(); //MapWindowManager.ShapeFileAttributesWindow = null; //if (MapWindowManager.MapWindowForm != null) //{ // MapWindowManager.MapWindowForm.Focus(); //} _instance = null; }