public static LayerPropertyForm GetInstance(MapLayersForm parent, int layerHandle) { if (_instance == null) { _instance = new LayerPropertyForm(parent, layerHandle); } return(_instance); }
public static PointLayerSymbologyForm GetInstance(LayerPropertyForm parent, MapLayer mapLayer) { if (_instance == null) { _instance = new PointLayerSymbologyForm(parent, mapLayer); } return(_instance); }
public PointLayerSymbologyForm(LayerPropertyForm parent, MapLayer mapLayer) { InitializeComponent(); _mapLayer = mapLayer; _shapeFile = mapLayer.LayerObject as Shapefile; _shpFileType = _shapeFile.ShapefileType; _options = _shapeFile.DefaultDrawingOptions; _originalOptions = _options; _parentForm = parent; }
/// <summary> /// event handler an item in the shortcut menu is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnMenuLayers_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { e.ClickedItem.Owner.Hide(); switch (e.ClickedItem.Name) { case "itemAttributes": var sfa = ShapefileAttributesForm.GetInstance(global.MappingForm, global.MappingForm.MapInterActionHandler); if (!sfa.Visible) { sfa.Show(this); } else { sfa.BringToFront(); } break; case "itemAddLayer": if (_parentForm.OpenFileDialog() == DialogResult.OK) { } break; case "itemRemoveLayer": MapLayers.RemoveLayer((int)layerGrid[0, _rowIndexFromMouseDown].Tag); break; case "itemLayerProperty": var lpf = LayerPropertyForm.GetInstance(this, (int)layerGrid[0, _rowIndexFromMouseDown].Tag); if (!lpf.Visible) { lpf.Show(this); } else { lpf.BringToFront(); } break; case "itemLayerExport": switch (_mapLayersHandler.CurrentMapLayer.LayerType) { case "ShapefileClass": ExportShapefile(); break; case "ImageClass": break; } break; } }
private void OnCellDoubleClick(object sender, DataGridViewCellEventArgs e) { //we only respond to double-click on the name column if (e.ColumnIndex == 1) { int layerHandle = (int)layerGrid[0, _rowIndexFromMouseDown].Tag; if (MapLayers[layerHandle].IsGraticule) { } else { var lpf = LayerPropertyForm.GetInstance(this, layerHandle); if (!lpf.Visible) { lpf.Show(this); } else { lpf.BringToFront(); } } } }
private void OnLayerPropertyForm_FormClosed(object sender, FormClosedEventArgs e) { _instance = null; global.SaveFormSettings(this); }