protected virtual void RenderPointTemplate(MapPointTemplate mapPointTemplate, Symbol coreSymbol, bool customTemplate, bool ignoreBackgroundColor, bool ignoreSize, bool ignoreMarker, bool hasScope)
        {
            if (mapPointTemplate == null)
            {
                RenderStyle(null, null, coreSymbol, ignoreBackgroundColor, hasScope);
                coreSymbol.BorderStyle = GetBorderStyle(null, null, hasScope);
                return;
            }
            RenderSpatialElementTemplate(mapPointTemplate, coreSymbol, ignoreBackgroundColor, hasScope);
            Style         style  = mapPointTemplate.Style;
            StyleInstance style2 = mapPointTemplate.Instance.Style;

            coreSymbol.BorderStyle = GetBorderStyle(style, style2, hasScope);
            if (!ignoreSize)
            {
                int   size = GetSize(mapPointTemplate, hasScope);
                float num3 = coreSymbol.Width = (coreSymbol.Height = size);
            }
            ReportEnumProperty <MapPointLabelPlacement> labelPlacement = mapPointTemplate.LabelPlacement;
            TextAlignment textAlignment = TextAlignment.Bottom;

            if (labelPlacement != null)
            {
                if (!labelPlacement.IsExpression)
                {
                    textAlignment = GetTextAlignment(labelPlacement.Value);
                }
                else if (hasScope)
                {
                    textAlignment = GetTextAlignment(mapPointTemplate.Instance.LabelPlacement);
                }
            }
            coreSymbol.TextAlignment = textAlignment;
        }
Exemple #2
0
        protected virtual void RenderLineTemplate(MapLineTemplate mapLineTemplate, Path corePath, bool ignoreBackgroundColor, bool ignoreSize, bool hasScope)
        {
            if (mapLineTemplate == null)
            {
                RenderStyle(null, null, corePath, ignoreBackgroundColor, hasScope);
                return;
            }
            RenderSpatialElementTemplate(mapLineTemplate, corePath, ignoreBackgroundColor, hasScope);
            Style         style  = mapLineTemplate.Style;
            StyleInstance style2 = mapLineTemplate.Instance.Style;

            corePath.LineStyle = GetBorderStyle(style, style2, hasScope);
            if (!ignoreSize)
            {
                int size = GetSize(mapLineTemplate, hasScope);
                corePath.Width = size;
            }
            ReportEnumProperty <MapLineLabelPlacement> labelPlacement = mapLineTemplate.LabelPlacement;
            PathLabelPosition labelPosition = PathLabelPosition.Above;

            if (labelPlacement != null)
            {
                if (!labelPlacement.IsExpression)
                {
                    labelPosition = GetLabelPosition(labelPlacement.Value);
                }
                else if (hasScope)
                {
                    labelPosition = GetLabelPosition(mapLineTemplate.Instance.LabelPlacement);
                }
            }
            corePath.LabelPosition = labelPosition;
        }
        internal static BorderStyles GetStyleBorderStyle(Border border)
        {
            ReportEnumProperty <BorderStyles> style = border.Style;

            if (!style.IsExpression)
            {
                return(style.Value);
            }
            return(border.Instance.Style);
        }
        internal static VerticalAlignments GetStyleVerticalAlignment(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <VerticalAlignments> verticalAlign = style.VerticalAlign;

            if (!verticalAlign.IsExpression)
            {
                return(verticalAlign.Value);
            }
            return(styleInstance.VerticalAlign);
        }
        internal static BackgroundHatchTypes GetStyleBackgroundHatchType(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <BackgroundHatchTypes> backgroundHatchType = style.BackgroundHatchType;

            if (!backgroundHatchType.IsExpression)
            {
                return(backgroundHatchType.Value);
            }
            return(styleInstance.BackgroundHatchType);
        }
        internal static TextEffects GetStyleTextEffect(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextEffects> textEffect = style.TextEffect;

            if (!textEffect.IsExpression)
            {
                return(textEffect.Value);
            }
            return(styleInstance.TextEffect);
        }
        internal static TextAlignments GetStyleTextAlign(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextAlignments> textAlign = style.TextAlign;

            if (!textAlign.IsExpression)
            {
                return(textAlign.Value);
            }
            return(styleInstance.TextAlign);
        }
        internal static FontStyles GetStyleFontStyle(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <FontStyles> fontStyle = style.FontStyle;

            if (IsStylePropertyDefined(fontStyle))
            {
                if (!fontStyle.IsExpression)
                {
                    return(fontStyle.Value);
                }
                return(styleInstance.FontStyle);
            }
            return(FontStyles.Normal);
        }
        internal static FontWeights GetStyleFontWeight(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <FontWeights> fontWeight = style.FontWeight;

            if (IsStylePropertyDefined(fontWeight))
            {
                if (!fontWeight.IsExpression)
                {
                    return(fontWeight.Value);
                }
                return(styleInstance.FontWeight);
            }
            return(FontWeights.Normal);
        }
 private void Parse()
 {
     if (m_parsed)
     {
         return;
     }
     try
     {
         m_parsed = true;
         m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.Definition;
         m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.Definition;
         ReportEnumProperty <MarkupType> markupType = m_textRunDef.MarkupType;
         MarkupType     markupType2    = (!markupType.IsExpression) ? markupType.Value : m_textRunDef.Instance.MarkupType;
         RichTextParser richTextParser = null;
         if (markupType2 != MarkupType.HTML)
         {
             return;
         }
         richTextParser = new HtmlParser(m_multipleParagraphsAllowed, this, this);
         InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)m_textRunDef.Instance;
         Microsoft.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, m_textRunDef.RenderingContext.OdpContext) : (originalValue.Value as string);
                 m_compiledParagraphCollection = (CompiledParagraphInstanceCollection)richTextParser.Parse(richText);
             }
             catch (Exception ex)
             {
                 m_errorContext.Register(ProcessingErrorCode.rsInvalidRichTextParseFailed, Severity.Warning, "TextRun", internalTextRunInstance.TextRunDef.Name, ex.Message);
                 m_parseErrorOccured         = true;
                 CreateSingleTextRun().Value = RPRes.rsRichTextParseErrorValue;
             }
         }
         else
         {
             ICompiledTextRunInstance compiledTextRunInstance = CreateSingleTextRun();
             if (originalValue.ErrorOccurred)
             {
                 compiledTextRunInstance.Value = RPRes.rsExpressionErrorValue;
             }
         }
     }
     finally
     {
         m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.None;
         m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.None;
     }
 }
Exemple #11
0
        protected MapRuleDistributionType GetDistributionType()
        {
            ReportEnumProperty <MapRuleDistributionType> distributionType = m_mapRule.DistributionType;

            if (distributionType != null)
            {
                if (!distributionType.IsExpression)
                {
                    return(distributionType.Value);
                }
                return(m_mapRule.Instance.DistributionType);
            }
            return(MapRuleDistributionType.Optimal);
        }
        internal static TextDecorations GetStyleFontTextDecoration(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextDecorations> textDecoration = style.TextDecoration;

            if (IsStylePropertyDefined(textDecoration))
            {
                if (!textDecoration.IsExpression)
                {
                    return(textDecoration.Value);
                }
                return(styleInstance.TextDecoration);
            }
            return(TextDecorations.None);
        }
Exemple #13
0
        private MapColorPalette GetColorPalette()
        {
            MapColorPaletteRule             mapColorPaletteRule = (MapColorPaletteRule)m_mapRule;
            ReportEnumProperty <MapPalette> palette             = mapColorPaletteRule.Palette;

            if (palette != null)
            {
                if (!palette.IsExpression)
                {
                    return(GetMapColorPalette(palette.Value));
                }
                return(GetMapColorPalette(mapColorPaletteRule.Instance.Palette));
            }
            return(MapColorPalette.Random);
        }
Exemple #14
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);
            }
        }
 internal ChartTickMarks(Axis.TickMarks type, Chart chart)
 {
     m_type  = new ReportEnumProperty <ChartTickMarksType>(GetTickMarksType(type));
     m_chart = chart;
 }
Exemple #16
0
        private void TranslateChartType(Microsoft.ReportingServices.ReportProcessing.Chart.ChartTypes chartType, Microsoft.ReportingServices.ReportProcessing.Chart.ChartSubTypes chartSubType)
        {
            ChartSeriesType    value  = ChartSeriesType.Column;
            ChartSeriesSubtype value2 = ChartSeriesSubtype.Plain;

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

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

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

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

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

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

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

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

                case Microsoft.ReportingServices.ReportProcessing.Chart.ChartTypes.Stock:
                    value  = ChartSeriesType.Range;
                    value2 = TranslateChartSubType(chartSubType);
                    break;
                }
            }
            m_chartSeriesType    = new ReportEnumProperty <ChartSeriesType>(value);
            m_chartSeriesSubtype = new ReportEnumProperty <ChartSeriesSubtype>(value2);
        }
Exemple #17
0
        internal void Render(MapPolygon mapPolygon, Shape coreShape, bool hasScope)
        {
            bool num = UseCustomTemplate(mapPolygon, hasScope);
            MapPolygonTemplate mapPolygonTemplate = (!num) ? MapPolygonLayer.MapPolygonTemplate : mapPolygon.MapPolygonTemplate;
            bool ignoreBackgroundColor            = !num && m_polygonLayerMapper.HasColorRule(coreShape) && hasScope;

            if (mapPolygonTemplate == null)
            {
                RenderStyle(null, null, coreShape, ignoreBackgroundColor, hasScope);
                coreShape.BorderStyle = GetBorderStyle(null, null, hasScope);
                return;
            }
            RenderSpatialElementTemplate(mapPolygonTemplate, coreShape, ignoreBackgroundColor, hasScope);
            Style         style  = mapPolygonTemplate.Style;
            StyleInstance style2 = mapPolygonTemplate.Instance.Style;

            coreShape.BorderStyle = 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 = GetTextVisibility(showLabel.Value);
                }
                else if (hasScope)
                {
                    coreShape.TextVisibility = GetTextVisibility(mapPolygonTemplate.Instance.ShowLabel);
                }
            }
            ReportEnumProperty <MapPolygonLabelPlacement> labelPlacement = mapPolygonTemplate.LabelPlacement;

            if (labelPlacement != null)
            {
                if (!labelPlacement.IsExpression)
                {
                    coreShape.TextAlignment = GetTextAlignment(labelPlacement.Value);
                }
                else if (hasScope)
                {
                    coreShape.TextAlignment = GetTextAlignment(mapPolygonTemplate.Instance.LabelPlacement);
                }
            }
        }