Exemple #1
0
 public static LayerPropertyForm GetInstance(MapLayersForm parent, int layerHandle)
 {
     if (_instance == null)
     {
         _instance = new LayerPropertyForm(parent, layerHandle);
     }
     return(_instance);
 }
Exemple #2
0
 public static PointLayerSymbologyForm GetInstance(LayerPropertyForm parent, MapLayer mapLayer)
 {
     if (_instance == null)
     {
         _instance = new PointLayerSymbologyForm(parent, mapLayer);
     }
     return(_instance);
 }
Exemple #3
0
 public PointLayerSymbologyForm(LayerPropertyForm parent, MapLayer mapLayer)
 {
     InitializeComponent();
     _mapLayer        = mapLayer;
     _shapeFile       = mapLayer.LayerObject as Shapefile;
     _shpFileType     = _shapeFile.ShapefileType;
     _options         = _shapeFile.DefaultDrawingOptions;
     _originalOptions = _options;
     _parentForm      = parent;
 }
Exemple #4
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;
            }
        }
Exemple #5
0
 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();
             }
         }
     }
 }
Exemple #6
0
 private void OnLayerPropertyForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     _instance = null;
     global.SaveFormSettings(this);
 }