Beispiel #1
0
 public static PolygonLineLayerSymbologyForm GetInstance(LayerPropertyForm parent, MapLayer mapLayer)
 {
     if (_instance == null)
     {
         _instance = new PolygonLineLayerSymbologyForm(parent, mapLayer);
     }
     return(_instance);
 }
Beispiel #2
0
        private void OnButtonClick(object sender, EventArgs e)
        {
            switch (((Button)sender).Name)
            {
            case "btnClear":
                txtVisibilityExpression.Text         = "";
                _shapefileLayer.VisibilityExpression = "";
                _parentForm.MainForm.MapControl.Redraw();
                break;

            case "btnLabelFeatures":
                var labelsForm = LabelsForm.GetInstance(_mapLayers, this);
                if (!labelsForm.Visible)
                {
                    labelsForm.Show(this);
                }
                else
                {
                    labelsForm.BringToFront();
                }
                break;

            case "btnLabelCategories":
                break;

            case "btnFeatureSymbols":
                switch (_shapefileLayer.ShapefileType)
                {
                case ShpfileType.SHP_POINT:
                    var pointSymbologyForm = PointLayerSymbologyForm.GetInstance(this, _mapLayer);
                    if (pointSymbologyForm.Visible)
                    {
                        pointSymbologyForm.BringToFront();
                    }
                    else
                    {
                        pointSymbologyForm.Show(this);
                    }
                    break;

                case ShpfileType.SHP_POLYGON:
                case ShpfileType.SHP_POLYLINE:
                    var symbologyForm = PolygonLineLayerSymbologyForm.GetInstance(this, _mapLayer);
                    if (symbologyForm.Visible)
                    {
                        symbologyForm.BringToFront();
                    }
                    else
                    {
                        symbologyForm.Show(this);
                    }
                    break;
                }

                break;

            case "btnFeatureCategories":
                break;

            case "btnClose":
                Close();
                break;

            case "btnDefineVisibilityExpression":
                var visibilityQueryForm = VisibilityQueryForm.GetInstance(_mapLayers);
                visibilityQueryForm.VisibilityExpression = txtVisibilityExpression.Text;
                visibilityQueryForm.ExpressionTarget     = VisibilityExpressionTarget.ExpressionTargetShape;
                if (!visibilityQueryForm.Visible)
                {
                    visibilityQueryForm.Show(this);
                }
                else
                {
                    visibilityQueryForm.BringToFront();
                }
                break;

            case "btnApplyVisibility":
                if (txtVisibilityExpression.Text.Length == 0)
                {
                    _shapefileLayer.VisibilityExpression = "";
                }
                else
                {
                    _shapefileLayer.VisibilityExpression = _mapLayer.ShapesVisibilityExpression;
                }
                _parentForm.MainForm.MapControl.Redraw();
                break;

            case "btnApply":
                _mapLayers.UpdateCurrentLayerName(txtLayerName.Text);
                btnApply.Enabled = false;
                break;
            }
        }
Beispiel #3
0
 private void OnFormClosed(object sender, FormClosedEventArgs e)
 {
     _instance = null;
 }