コード例 #1
0
        private void OnMenuClick(object sender, EventArgs e)
        {
            switch (((ToolStripMenuItem)sender).Name)
            {
            case "menuAddLayer":
                _parent.AddLayer();
                break;

            case "menuLayerProperties":
                ShowLayerProperties();
                break;

            case "menuLayerAttributes":
                var sfa = ShapefileAttributesForm.GetInstance(_parent, _parent.MapInterActionHandler);
                if (!sfa.Visible)
                {
                    sfa.Show(this);
                }
                else
                {
                    sfa.BringToFront();
                }
                break;

            case "menuRemoveLayer":
                MapLayers.RemoveLayer((int)layerGrid[0, _rowIndexFromMouseDown].Tag);
                break;
            }
        }
コード例 #2
0
 private void ShapefileAttributesForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     MapInterActionHandler.MapLayersHandler.CurrentLayer -= OnCurrentLayer;
     MapInterActionHandler.Selection -= OnLayerSelection;
     _instance = null;
     Cleanup();
 }
コード例 #3
0
 public static ShapefileAttributesForm GetInstance(MainWindowForm parentForm, MapInterActionHandler mapInterActionHandler)
 {
     if (_instance == null)
     {
         _instance = new ShapefileAttributesForm(parentForm, mapInterActionHandler);
     }
     return(_instance);
 }