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;
        }
Esempio n. 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;
        }
Esempio n. 3
0
 public GradientType GetGradientType(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null && (!MappingHelper.IsPropertyExpression(style.BackgroundGradientType) || hasScope))
     {
         return(MapMapper.GetGradientType(style, styleInstance));
     }
     return(GradientType.None);
 }
Esempio n. 4
0
        public GradientType GetGradientType(bool hasScope)
        {
            Style         style         = default(Style);
            StyleInstance styleInstance = default(StyleInstance);

            this.GetDefaultStyle(out style, out styleInstance);
            return(this.GetGradientType(style, styleInstance, hasScope));
        }
Esempio n. 5
0
 public MapHatchStyle GetHatchStyle(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null && (!MappingHelper.IsPropertyExpression(style.BackgroundHatchType) || hasScope))
     {
         return(MapMapper.GetHatchStyle(style, styleInstance));
     }
     return(MapHatchStyle.None);
 }
Esempio n. 6
0
 public int GetShadowOffset(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null && (!MappingHelper.IsPropertyExpression(style.ShadowOffset) || hasScope))
     {
         return(MapMapper.GetValidShadowOffset(MappingHelper.GetStyleShadowOffset(style, styleInstance, this.m_mapMapper.DpiX)));
     }
     return(0);
 }
Esempio n. 7
0
        public int GetShadowOffset(bool hasScope)
        {
            Style         style         = default(Style);
            StyleInstance styleInstance = default(StyleInstance);

            this.GetDefaultStyle(out style, out styleInstance);
            return(this.GetShadowOffset(style, styleInstance, hasScope));
        }
Esempio n. 8
0
 public Color GetTextColor(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null && (!MappingHelper.IsPropertyExpression(style.Color) || hasScope))
     {
         return(MappingHelper.GetStyleColor(style, styleInstance));
     }
     return(MappingHelper.DefaultColor);
 }
Esempio n. 9
0
 public Color GetBackGradientEndColor(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null && (!MappingHelper.IsPropertyExpression(style.BackgroundGradientEndColor) || hasScope))
     {
         return(MappingHelper.GetStyleBackGradientEndColor(style, styleInstance));
     }
     return(Color.Empty);
 }
Esempio n. 10
0
        public MapDashStyle GetBorderStyle(bool hasScope)
        {
            Style         style         = default(Style);
            StyleInstance styleInstance = default(StyleInstance);

            this.GetDefaultStyle(out style, out styleInstance);
            return(this.GetBorderStyle(style, styleInstance, hasScope));
        }
 internal static RightToLeft GetStyleDirection(Style style, StyleInstance styleInstance)
 {
     if ((style.Direction.IsExpression ? styleInstance.Direction : style.Direction.Value) == Directions.RTL)
     {
         return(RightToLeft.Yes);
     }
     return(RightToLeft.No);
 }
Esempio n. 12
0
        public int GetBorderWidth(bool hasScope)
        {
            Style         style         = default(Style);
            StyleInstance styleInstance = default(StyleInstance);

            this.GetDefaultStyle(out style, out styleInstance);
            return(this.GetBorderWidth(style, styleInstance, hasScope));
        }
Esempio n. 13
0
        public Color GetBorderColor(bool hasScope)
        {
            Style         style         = default(Style);
            StyleInstance styleInstance = default(StyleInstance);

            this.GetDefaultStyle(out style, out styleInstance);
            return(this.GetBorderColor(style, styleInstance, hasScope));
        }
        internal static ContentAlignment GetStyleContentAlignment(Style style, StyleInstance styleInstance)
        {
            TextAlignments     styleTextAlign         = GetStyleTextAlign(style, styleInstance);
            VerticalAlignments styleVerticalAlignment = GetStyleVerticalAlignment(style, styleInstance);
            ContentAlignment   result = ContentAlignment.TopLeft;

            switch (styleTextAlign)
            {
            case TextAlignments.Center:
                switch (styleVerticalAlignment)
                {
                case VerticalAlignments.Bottom:
                    result = ContentAlignment.BottomCenter;
                    break;

                case VerticalAlignments.Middle:
                    result = ContentAlignment.MiddleCenter;
                    break;

                default:
                    result = ContentAlignment.TopCenter;
                    break;
                }
                break;

            case TextAlignments.Right:
                switch (styleVerticalAlignment)
                {
                case VerticalAlignments.Bottom:
                    result = ContentAlignment.BottomRight;
                    break;

                case VerticalAlignments.Middle:
                    result = ContentAlignment.MiddleRight;
                    break;

                default:
                    result = ContentAlignment.TopRight;
                    break;
                }
                break;

            default:
                switch (styleVerticalAlignment)
                {
                case VerticalAlignments.Bottom:
                    result = ContentAlignment.BottomLeft;
                    break;

                case VerticalAlignments.Middle:
                    result = ContentAlignment.MiddleLeft;
                    break;
                }
                break;
            }
            return(result);
        }
        internal static VerticalAlignments GetStyleVerticalAlignment(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <VerticalAlignments> verticalAlign = style.VerticalAlign;

            if (!verticalAlign.IsExpression)
            {
                return(verticalAlign.Value);
            }
            return(styleInstance.VerticalAlign);
        }
        internal static BackgroundGradients GetStyleBackGradientType(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <BackgroundGradients> backgroundGradientType = style.BackgroundGradientType;

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

            if (!textEffect.IsExpression)
            {
                return(textEffect.Value);
            }
            return(styleInstance.TextEffect);
        }
Esempio n. 18
0
        public static RightToLeft GetStyleDirection(Style style, StyleInstance styleInstance)
        {
            Directions directions = style.Direction.IsExpression ? styleInstance.Direction : style.Direction.Value;

            if (directions == Directions.RTL)
            {
                return(RightToLeft.Yes);
            }
            return(RightToLeft.No);
        }
        internal static TextAlignments GetStyleTextAlign(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextAlignments> textAlign = style.TextAlign;

            if (!textAlign.IsExpression)
            {
                return(textAlign.Value);
            }
            return(styleInstance.TextAlign);
        }
Esempio n. 20
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. 21
0
 public MapDashStyle GetBorderStyle(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null)
     {
         Border border = style.Border;
         if (border != null)
         {
             return(MapMapper.GetDashStyle(border, hasScope, false));
         }
     }
     return(MapDashStyle.Solid);
 }
Esempio n. 22
0
 public Color GetBorderColor(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null)
     {
         Border border = style.Border;
         if (border != null && (!MappingHelper.IsPropertyExpression(border.Color) || hasScope))
         {
             return(MappingHelper.GetStyleBorderColor(border));
         }
     }
     return(MappingHelper.DefaultBorderColor);
 }
Esempio n. 23
0
 public int GetBorderWidth(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style != null)
     {
         Border border = style.Border;
         if (border != null && (!MappingHelper.IsPropertyExpression(border.Width) || hasScope))
         {
             return(MappingHelper.GetStyleBorderWidth(border, this.m_mapMapper.DpiX));
         }
     }
     return(MappingHelper.GetDefaultBorderWidth(this.m_mapMapper.DpiX));
 }
Esempio n. 24
0
 public Color GetBackgroundColor(Style style, StyleInstance styleInstance, bool hasScope)
 {
     if (style == null)
     {
         return(MappingHelper.DefaultBackgroundColor);
     }
     if (MappingHelper.IsPropertyExpression(style.BackgroundColor) && !hasScope)
     {
         return(MappingHelper.DefaultBackgroundColor);
     }
     return(MappingHelper.GetStyleBackgroundColor(style, styleInstance));
 }
        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);
        }
        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);
        }
        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 Color GetStyleShadowColor(Style style, StyleInstance styleInstance)
        {
            ReportColorProperty shadowColor = style.ShadowColor;
            Color color = m_defaultShadowColor;

            if (!GetColorFromReportColorProperty(shadowColor, ref color))
            {
                ReportColor shadowColor2 = styleInstance.ShadowColor;
                if (shadowColor2 != null)
                {
                    color = shadowColor2.ToColor();
                }
            }
            return(color);
        }
        internal static Color GetStyleColor(Style style, StyleInstance styleInstance)
        {
            ReportColorProperty color = style.Color;
            Color color2 = Color.Black;

            if (!GetColorFromReportColorProperty(color, ref color2))
            {
                ReportColor color3 = styleInstance.Color;
                if (color3 != null)
                {
                    color2 = color3.ToColor();
                }
            }
            return(color2);
        }
        internal static Color GetStyleBackGradientEndColor(Style style, StyleInstance styleInstance)
        {
            ReportColorProperty backgroundGradientEndColor = style.BackgroundGradientEndColor;
            Color color = Color.Empty;

            if (!GetColorFromReportColorProperty(backgroundGradientEndColor, ref color))
            {
                ReportColor backgroundGradientEndColor2 = styleInstance.BackgroundGradientEndColor;
                if (backgroundGradientEndColor2 != null)
                {
                    color = backgroundGradientEndColor2.ToColor();
                }
            }
            return(color);
        }
Esempio n. 31
0
 IStyleInstance IStyleEngine.CreateInstance(string StyleName)
 {
     StyleInstance myInstance = new StyleInstance();
     return myInstance;
 }