Beispiel #1
0
 private void ShapefileAttributesForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     MapInterActionHandler.MapLayersHandler.CurrentLayer -= OnCurrentLayer;
     MapInterActionHandler.Selection -= OnLayerSelection;
     global.SaveFormSettings(this);
     _instance = null;
     Cleanup();
 }
Beispiel #2
0
 public static ShapefileAttributesForm GetInstance(MapperForm parentForm, MapInterActionHandler mapInterActionHandler)
 {
     if (_instance == null)
     {
         _instance = new ShapefileAttributesForm(parentForm, mapInterActionHandler);
     }
     return(_instance);
 }
Beispiel #3
0
        /// <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;
            }
        }