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);
                    }
                }
            }
        }
 public MapPolygonInstance(MapPolygon defObject)
     : base(defObject)
 {
     this.m_defObject = defObject;
 }