Esempio n. 1
0
 protected virtual void RenderLineTemplate(MapLineTemplate mapLineTemplate, Path corePath, bool ignoreBackgroundColor, bool ignoreSize, bool hasScope)
 {
     if (mapLineTemplate == null)
     {
         base.RenderStyle(null, null, corePath, ignoreBackgroundColor, hasScope);
     }
     else
     {
         base.RenderSpatialElementTemplate(mapLineTemplate, corePath, ignoreBackgroundColor, hasScope);
         Style         style  = mapLineTemplate.Style;
         StyleInstance style2 = mapLineTemplate.Instance.Style;
         corePath.LineStyle = base.GetBorderStyle(style, style2, hasScope);
         if (!ignoreSize)
         {
             int size = this.GetSize(mapLineTemplate, hasScope);
             corePath.Width = (float)size;
         }
         ReportEnumProperty <MapLineLabelPlacement> labelPlacement = mapLineTemplate.LabelPlacement;
         PathLabelPosition labelPosition = PathLabelPosition.Above;
         if (labelPlacement != null)
         {
             if (!labelPlacement.IsExpression)
             {
                 labelPosition = this.GetLabelPosition(labelPlacement.Value);
             }
             else if (hasScope)
             {
                 labelPosition = this.GetLabelPosition(mapLineTemplate.Instance.LabelPlacement);
             }
         }
         corePath.LabelPosition = labelPosition;
     }
 }
 protected virtual void RenderPointTemplate(MapPointTemplate mapPointTemplate, Symbol coreSymbol, bool customTemplate, bool ignoreBackgroundColor, bool ignoreSize, bool ignoreMarker, bool hasScope)
 {
     if (mapPointTemplate == null)
     {
         base.RenderStyle(null, null, coreSymbol, ignoreBackgroundColor, hasScope);
         coreSymbol.BorderStyle = base.GetBorderStyle(null, null, hasScope);
     }
     else
     {
         base.RenderSpatialElementTemplate(mapPointTemplate, coreSymbol, ignoreBackgroundColor, hasScope);
         Style         style  = mapPointTemplate.Style;
         StyleInstance style2 = mapPointTemplate.Instance.Style;
         coreSymbol.BorderStyle = base.GetBorderStyle(style, style2, hasScope);
         if (!ignoreSize)
         {
             int   size = this.GetSize(mapPointTemplate, hasScope);
             float num3 = coreSymbol.Width = (coreSymbol.Height = (float)size);
         }
         ReportEnumProperty <MapPointLabelPlacement> labelPlacement = mapPointTemplate.LabelPlacement;
         TextAlignment textAlignment = TextAlignment.Bottom;
         if (labelPlacement != null)
         {
             if (!labelPlacement.IsExpression)
             {
                 textAlignment = this.GetTextAlignment(labelPlacement.Value);
             }
             else if (hasScope)
             {
                 textAlignment = this.GetTextAlignment(mapPointTemplate.Instance.LabelPlacement);
             }
         }
         coreSymbol.TextAlignment = textAlignment;
     }
 }
Esempio n. 3
0
        public static TextEffects GetStyleTextEffect(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextEffects> textEffect = style.TextEffect;

            if (!textEffect.IsExpression)
            {
                return(textEffect.Value);
            }
            return(styleInstance.TextEffect);
        }
Esempio n. 4
0
        public static VerticalAlignments GetStyleVerticalAlignment(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <VerticalAlignments> verticalAlign = style.VerticalAlign;

            if (!verticalAlign.IsExpression)
            {
                return(verticalAlign.Value);
            }
            return(styleInstance.VerticalAlign);
        }
Esempio n. 5
0
        public static TextAlignments GetStyleTextAlign(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextAlignments> textAlign = style.TextAlign;

            if (!textAlign.IsExpression)
            {
                return(textAlign.Value);
            }
            return(styleInstance.TextAlign);
        }
Esempio n. 6
0
        public static BorderStyles GetStyleBorderStyle(Border border)
        {
            ReportEnumProperty <BorderStyles> style = border.Style;

            if (!style.IsExpression)
            {
                return(style.Value);
            }
            return(border.Instance.Style);
        }
Esempio n. 7
0
        public static BackgroundHatchTypes GetStyleBackgroundHatchType(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <BackgroundHatchTypes> backgroundHatchType = style.BackgroundHatchType;

            if (!backgroundHatchType.IsExpression)
            {
                return(backgroundHatchType.Value);
            }
            return(styleInstance.BackgroundHatchType);
        }
Esempio n. 8
0
        public static FontStyles GetStyleFontStyle(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <FontStyles> fontStyle = style.FontStyle;

            if (MappingHelper.IsStylePropertyDefined(fontStyle))
            {
                if (!fontStyle.IsExpression)
                {
                    return(fontStyle.Value);
                }
                return(styleInstance.FontStyle);
            }
            return(FontStyles.Normal);
        }
Esempio n. 9
0
        public static TextDecorations GetStyleFontTextDecoration(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextDecorations> textDecoration = style.TextDecoration;

            if (MappingHelper.IsStylePropertyDefined(textDecoration))
            {
                if (!textDecoration.IsExpression)
                {
                    return(textDecoration.Value);
                }
                return(styleInstance.TextDecoration);
            }
            return(TextDecorations.None);
        }
 private void Parse()
 {
     if (!this.m_parsed)
     {
         try
         {
             this.m_parsed = true;
             this.m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.Definition;
             this.m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.Definition;
             ReportEnumProperty <MarkupType> markupType = this.m_textRunDef.MarkupType;
             MarkupType     markupType2    = (!markupType.IsExpression) ? markupType.Value : this.m_textRunDef.Instance.MarkupType;
             RichTextParser richTextParser = null;
             MarkupType     markupType3    = markupType2;
             if (markupType3 == MarkupType.HTML)
             {
                 richTextParser = new HtmlParser(this.m_multipleParagraphsAllowed, this, this);
                 InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)this.m_textRunDef.Instance;
                 AspNetCore.ReportingServices.RdlExpressions.VariantResult originalValue = internalTextRunInstance.GetOriginalValue();
                 if (!originalValue.ErrorOccurred && originalValue.TypeCode != 0)
                 {
                     try
                     {
                         string richText = (originalValue.TypeCode != TypeCode.String) ? internalTextRunInstance.TextRunDef.FormatTextRunValue(originalValue.Value, originalValue.TypeCode, this.m_textRunDef.RenderingContext.OdpContext) : (originalValue.Value as string);
                         this.m_compiledParagraphCollection = (CompiledParagraphInstanceCollection)richTextParser.Parse(richText);
                     }
                     catch (Exception ex)
                     {
                         this.m_errorContext.Register(ProcessingErrorCode.rsInvalidRichTextParseFailed, Severity.Warning, "TextRun", internalTextRunInstance.TextRunDef.Name, ex.Message);
                         this.m_parseErrorOccured = true;
                         ICompiledTextRunInstance compiledTextRunInstance = this.CreateSingleTextRun();
                         compiledTextRunInstance.Value = RPRes.rsRichTextParseErrorValue;
                     }
                 }
                 else
                 {
                     ICompiledTextRunInstance compiledTextRunInstance2 = this.CreateSingleTextRun();
                     if (originalValue.ErrorOccurred)
                     {
                         compiledTextRunInstance2.Value = RPRes.rsExpressionErrorValue;
                     }
                 }
             }
         }
         finally
         {
             this.m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.None;
             this.m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.None;
         }
     }
 }
Esempio n. 11
0
        protected MapRuleDistributionType GetDistributionType()
        {
            ReportEnumProperty <MapRuleDistributionType> distributionType = this.m_mapRule.DistributionType;

            if (distributionType != null)
            {
                if (!distributionType.IsExpression)
                {
                    return(distributionType.Value);
                }
                return(this.m_mapRule.Instance.DistributionType);
            }
            return(MapRuleDistributionType.Optimal);
        }
Esempio n. 12
0
        private MapColorPalette GetColorPalette()
        {
            MapColorPaletteRule             mapColorPaletteRule = (MapColorPaletteRule)base.m_mapRule;
            ReportEnumProperty <MapPalette> palette             = mapColorPaletteRule.Palette;

            if (palette != null)
            {
                if (!palette.IsExpression)
                {
                    return(this.GetMapColorPalette(palette.Value));
                }
                return(this.GetMapColorPalette(mapColorPaletteRule.Instance.Palette));
            }
            return(MapColorPalette.Random);
        }
Esempio n. 13
0
        private TileSystem GetTileSystem(MapTileLayer mapTileLayer)
        {
            ReportEnumProperty <MapTileStyle> tileStyle = mapTileLayer.TileStyle;
            MapTileStyle mapTileStyle = MapTileStyle.Road;

            if (tileStyle != null)
            {
                mapTileStyle = (tileStyle.IsExpression ? mapTileLayer.Instance.TileStyle : tileStyle.Value);
            }
            switch (mapTileStyle)
            {
            case MapTileStyle.Aerial:
                return(TileSystem.VirtualEarthAerial);

            case MapTileStyle.Hybrid:
                return(TileSystem.VirtualEarthHybrid);

            default:
                return(TileSystem.VirtualEarthRoad);
            }
        }
 public ChartTickMarks(Axis.TickMarks type, Chart chart)
 {
     this.m_type  = new ReportEnumProperty <ChartTickMarksType>(this.GetTickMarksType(type));
     this.m_chart = chart;
 }
Esempio n. 15
0
        private void TranslateChartType(AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes chartType, AspNetCore.ReportingServices.ReportProcessing.Chart.ChartSubTypes chartSubType)
        {
            ChartSeriesType    value  = ChartSeriesType.Column;
            ChartSeriesSubtype value2 = ChartSeriesSubtype.Plain;

            if (this.m_plotAsLine && chartType != AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Line)
            {
                value  = ChartSeriesType.Line;
                value2 = ChartSeriesSubtype.Plain;
            }
            else
            {
                switch (chartType)
                {
                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Area:
                    value  = ChartSeriesType.Area;
                    value2 = this.TranslateChartSubType(chartSubType);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Bar:
                    value  = ChartSeriesType.Bar;
                    value2 = this.TranslateChartSubType(chartSubType);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Column:
                    value  = ChartSeriesType.Column;
                    value2 = this.TranslateChartSubType(chartSubType);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Line:
                    value  = ChartSeriesType.Line;
                    value2 = this.TranslateChartSubType(chartSubType);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Pie:
                    value  = ChartSeriesType.Shape;
                    value2 = (ChartSeriesSubtype)((chartSubType != AspNetCore.ReportingServices.ReportProcessing.Chart.ChartSubTypes.Exploded) ? 5 : 6);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Doughnut:
                    value  = ChartSeriesType.Shape;
                    value2 = (ChartSeriesSubtype)((chartSubType != AspNetCore.ReportingServices.ReportProcessing.Chart.ChartSubTypes.Exploded) ? 7 : 8);
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Scatter:
                    if (chartSubType == AspNetCore.ReportingServices.ReportProcessing.Chart.ChartSubTypes.Plain)
                    {
                        value  = ChartSeriesType.Scatter;
                        value2 = ChartSeriesSubtype.Plain;
                    }
                    else
                    {
                        value  = ChartSeriesType.Line;
                        value2 = (ChartSeriesSubtype)((chartSubType != AspNetCore.ReportingServices.ReportProcessing.Chart.ChartSubTypes.Line) ? 3 : 0);
                    }
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Bubble:
                    value  = ChartSeriesType.Scatter;
                    value2 = ChartSeriesSubtype.Bubble;
                    break;

                case AspNetCore.ReportingServices.ReportProcessing.Chart.ChartTypes.Stock:
                    value  = ChartSeriesType.Range;
                    value2 = this.TranslateChartSubType(chartSubType);
                    break;
                }
            }
            this.m_chartSeriesType    = new ReportEnumProperty <ChartSeriesType>(value);
            this.m_chartSeriesSubtype = new ReportEnumProperty <ChartSeriesSubtype>(value2);
        }
        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);
                    }
                }
            }
        }