Exemplo n.º 1
0
        public void RenderPolygonRule(PolygonTemplateMapper shapeTemplateMapper)
        {
            ShapeRule shapeRule = (ShapeRule)base.m_coreRule;

            base.SetRuleLegendProperties(shapeRule);
            base.SetRuleDistribution(shapeRule);
            shapeRule.ShowInColorSwatch = this.GetShowInColorScale();
            if (base.m_mapRule is MapColorRangeRule)
            {
                this.RenderPolygonColorRangeRule(shapeRule);
            }
            else if (base.m_mapRule is MapColorPaletteRule)
            {
                this.RenderPolygonColorPaletteRule(shapeRule);
            }
            else
            {
                this.RenderPolygonCustomColorRule(shapeRule);
            }
            this.InitializeCustomColors(shapeRule.CustomColors, shapeTemplateMapper);
        }
Exemplo n.º 2
0
 public PolygonLayerMapper(MapPolygonLayer mapPolygonLayer, MapControl coreMap, MapMapper mapMapper)
     : base(mapPolygonLayer, coreMap, mapMapper)
 {
     this.m_polygonTemplateMapper = new PolygonTemplateMapper(base.m_mapMapper, this, this.MapPolygonLayer);
     base.m_pointTemplateMapper   = base.CreatePointTemplateMapper();
 }
        public void Render(MapPolygon mapPolygon, Shape coreShape, bool hasScope)
        {
            bool flag = PolygonTemplateMapper.UseCustomTemplate(mapPolygon, hasScope);
            MapPolygonTemplate mapPolygonTemplate = (!flag) ? this.MapPolygonLayer.MapPolygonTemplate : mapPolygon.MapPolygonTemplate;
            bool ignoreBackgroundColor            = !flag && this.m_polygonLayerMapper.HasColorRule(coreShape) && hasScope;

            if (mapPolygonTemplate == null)
            {
                base.RenderStyle(null, null, coreShape, ignoreBackgroundColor, hasScope);
                coreShape.BorderStyle = base.GetBorderStyle(null, null, hasScope);
            }
            else
            {
                base.RenderSpatialElementTemplate(mapPolygonTemplate, coreShape, ignoreBackgroundColor, hasScope);
                Style         style  = mapPolygonTemplate.Style;
                StyleInstance style2 = mapPolygonTemplate.Instance.Style;
                coreShape.BorderStyle = base.GetBorderStyle(style, style2, hasScope);
                ReportDoubleProperty scaleFactor = mapPolygonTemplate.ScaleFactor;
                if (scaleFactor != null)
                {
                    if (!scaleFactor.IsExpression)
                    {
                        coreShape.ScaleFactor = scaleFactor.Value;
                    }
                    else if (hasScope)
                    {
                        coreShape.ScaleFactor = mapPolygonTemplate.Instance.ScaleFactor;
                    }
                }
                ReportDoubleProperty centerPointOffsetX = mapPolygonTemplate.CenterPointOffsetX;
                if (centerPointOffsetX != null)
                {
                    if (!centerPointOffsetX.IsExpression)
                    {
                        coreShape.CentralPointOffset.X = centerPointOffsetX.Value;
                    }
                    else if (hasScope)
                    {
                        coreShape.CentralPointOffset.X = mapPolygonTemplate.Instance.CenterPointOffsetX;
                    }
                }
                centerPointOffsetX = mapPolygonTemplate.CenterPointOffsetY;
                if (centerPointOffsetX != null)
                {
                    if (!centerPointOffsetX.IsExpression)
                    {
                        coreShape.CentralPointOffset.Y = centerPointOffsetX.Value;
                    }
                    else if (hasScope)
                    {
                        coreShape.CentralPointOffset.Y = mapPolygonTemplate.Instance.CenterPointOffsetY;
                    }
                }
                ReportEnumProperty <MapAutoBool> showLabel = mapPolygonTemplate.ShowLabel;
                if (showLabel != null)
                {
                    if (!showLabel.IsExpression)
                    {
                        coreShape.TextVisibility = this.GetTextVisibility(showLabel.Value);
                    }
                    else if (hasScope)
                    {
                        coreShape.TextVisibility = this.GetTextVisibility(mapPolygonTemplate.Instance.ShowLabel);
                    }
                }
                ReportEnumProperty <MapPolygonLabelPlacement> labelPlacement = mapPolygonTemplate.LabelPlacement;
                if (labelPlacement != null)
                {
                    if (!labelPlacement.IsExpression)
                    {
                        coreShape.TextAlignment = this.GetTextAlignment(labelPlacement.Value);
                    }
                    else if (hasScope)
                    {
                        coreShape.TextAlignment = this.GetTextAlignment(mapPolygonTemplate.Instance.LabelPlacement);
                    }
                }
            }
        }