Beispiel #1
0
        public void VisibilityExpression(string expression, VisibilityExpressionTarget expressiontarget)
        {
            if (expressiontarget == VisibilityExpressionTarget.ExpressionTargetLabel)
            {
                _currentMapLayer.LabelsVisibilityExpression = expression;
            }
            else
            {
                _currentMapLayer.ShapesVisibilityExpression = expression;
            }

            if (OnVisibilityExpressionSet != null)
            {
                //fill up the event argument class with the layer item
                LayerEventArg lp = new LayerEventArg(_currentMapLayer.Handle, expressiontarget, expression);
                OnVisibilityExpressionSet(this, lp);
            }
        }
Beispiel #2
0
        public void VisibilityExpression(string expression, VisibilityExpressionTarget expressiontarget)
        {
            var sf = (Shapefile)_currentMapLayer.LayerObject;

            if (expressiontarget == VisibilityExpressionTarget.ExpressionTargetLabel)
            {
                _currentMapLayer.LabelsVisibilityExpression = expression;
                sf.Labels.VisibilityExpression = expression;
            }
            else
            {
                _currentMapLayer.ShapesVisibilityExpression = expression;
                sf.VisibilityExpression = expression;
            }
            MapControl.Redraw();
            if (OnVisibilityExpressionSet != null)
            {
                //fill up the event argument class with the layer item
                LayerEventArg lp = new LayerEventArg(_currentMapLayer.Handle, expressiontarget, expression);
                lp.Shapefile = sf;
                OnVisibilityExpressionSet(this, lp);
            }
        }
Beispiel #3
0
 public LayerEventArg(int layerHandle, VisibilityExpressionTarget target, string visibilityExpression)
 {
     LayerHandle          = layerHandle;
     ExpressionTarget     = target;
     VisibilityExpression = visibilityExpression;
 }