public int GetSize(MapPointTemplate mapPointTemplate, bool hasScope)
        {
            ReportSizeProperty size = mapPointTemplate.Size;

            if (size != null)
            {
                if (!size.IsExpression)
                {
                    return(MappingHelper.ToIntPixels(size.Value, base.m_mapMapper.DpiX));
                }
                if (hasScope)
                {
                    return(MappingHelper.ToIntPixels(mapPointTemplate.Instance.Size, base.m_mapMapper.DpiX));
                }
                return(PointTemplateMapper.GetDefaultSymbolSize(base.m_mapMapper.DpiX));
            }
            return(PointTemplateMapper.GetDefaultSymbolSize(base.m_mapMapper.DpiX));
        }
Exemplo n.º 2
0
        public int GetSize(MapLineTemplate mapLineTemplate, bool hasScope)
        {
            ReportSizeProperty width = mapLineTemplate.Width;

            if (width != null)
            {
                if (!width.IsExpression)
                {
                    return(MappingHelper.ToIntPixels(width.Value, base.m_mapMapper.DpiX));
                }
                if (hasScope)
                {
                    return(MappingHelper.ToIntPixels(mapLineTemplate.Instance.Width, base.m_mapMapper.DpiX));
                }
                return(LineTemplateMapper.GetDefaultSize(base.m_mapMapper.DpiX));
            }
            return(LineTemplateMapper.GetDefaultSize(base.m_mapMapper.DpiX));
        }
Exemplo n.º 3
0
        private Color GetToColor(MapColorRangeRule colorRangeRule)
        {
            ReportColorProperty endColor = colorRangeRule.EndColor;
            Color defaultToColor         = ColorRuleMapper.m_defaultToColor;

            if (endColor != null)
            {
                if (MappingHelper.GetColorFromReportColorProperty(endColor, ref defaultToColor))
                {
                    return(defaultToColor);
                }
                if (colorRangeRule.Instance.EndColor != null)
                {
                    return(colorRangeRule.Instance.EndColor.ToColor());
                }
            }
            return(defaultToColor);
        }
Exemplo n.º 4
0
        private Color GetCustomColor(MapCustomColor mapCustomColor)
        {
            ReportColorProperty color = mapCustomColor.Color;
            Color empty = Color.Empty;

            if (color != null)
            {
                if (MappingHelper.GetColorFromReportColorProperty(color, ref empty))
                {
                    return(empty);
                }
                ReportColor color2 = mapCustomColor.Instance.Color;
                if (color2 != null)
                {
                    return(color2.ToColor());
                }
            }
            return(empty);
        }
Exemplo n.º 5
0
        public static string GetStyleFontFamily(Style style, StyleInstance styleInstance, string fallbackFont)
        {
            ReportStringProperty fontFamily = style.FontFamily;

            if (MappingHelper.IsStylePropertyDefined(fontFamily))
            {
                if (!fontFamily.IsExpression)
                {
                    if (fontFamily != null)
                    {
                        return(fontFamily.Value);
                    }
                }
                else if (styleInstance.FontFamily != null)
                {
                    return(styleInstance.FontFamily);
                }
            }
            return(fallbackFont);
        }
Exemplo n.º 6
0
        public static float GetStyleFontSize(Style style, StyleInstance styleInstance)
        {
            ReportSizeProperty fontSize = style.FontSize;

            if (MappingHelper.IsStylePropertyDefined(fontSize))
            {
                if (!fontSize.IsExpression)
                {
                    return((float)fontSize.Value.ToPoints());
                }
                if (styleInstance.FontSize != null)
                {
                    ReportSize fontSize2 = styleInstance.FontSize;
                    if (fontSize2 != null)
                    {
                        return((float)fontSize2.ToPoints());
                    }
                }
            }
            return(MappingHelper.DefaultFontSize);
        }
Exemplo n.º 7
0
        public static int GetStyleBorderWidth(Border border, float dpi)
        {
            ReportSizeProperty width = border.Width;
            int result = MappingHelper.GetDefaultBorderWidth(dpi);

            if (!width.IsExpression)
            {
                if (width.Value != null)
                {
                    result = MappingHelper.ToIntPixels(width.Value, dpi);
                }
            }
            else
            {
                ReportSize width2 = border.Instance.Width;
                if (width2 != null)
                {
                    result = MappingHelper.ToIntPixels(width2, dpi);
                }
            }
            return(result);
        }
Exemplo n.º 8
0
        public Font GetFont(Style style, StyleInstance styleInstance, bool hasScope)
        {
            if (style == null)
            {
                return(this.m_mapMapper.GetDefaultFontFromCache(0));
            }
            string text = MappingHelper.DefaultFontFamily;

            if (this.m_mapMapper.GetDefaultFont() != null)
            {
                text = this.m_mapMapper.GetDefaultFont().Name;
            }
            if (!MappingHelper.IsPropertyExpression(style.FontFamily) || hasScope)
            {
                text = MappingHelper.GetStyleFontFamily(style, styleInstance, text);
            }
            float           fontSize       = (MappingHelper.IsPropertyExpression(style.FontSize) && !hasScope) ? MappingHelper.DefaultFontSize : MappingHelper.GetStyleFontSize(style, styleInstance);
            FontStyles      fontStyle      = (MappingHelper.IsPropertyExpression(style.FontStyle) && !hasScope) ? FontStyles.Normal : MappingHelper.GetStyleFontStyle(style, styleInstance);
            FontWeights     fontWeight     = (MappingHelper.IsPropertyExpression(style.FontWeight) && !hasScope) ? FontWeights.Normal : MappingHelper.GetStyleFontWeight(style, styleInstance);
            TextDecorations textDecoration = (MappingHelper.IsPropertyExpression(style.TextDecoration) && !hasScope) ? TextDecorations.None : MappingHelper.GetStyleFontTextDecoration(style, styleInstance);

            return(this.m_mapMapper.GetFontFromCache(0, text, fontSize, fontStyle, fontWeight, textDecoration));
        }
 public static int GetDefaultSymbolSize(float dpi)
 {
     return(MappingHelper.ToIntPixels(PointTemplateMapper.m_defaultSymbolSize, dpi));
 }
Exemplo n.º 10
0
        public static MemoryStream CreateExceptionImage(Exception exception, int width, int height, float dpiX, float dpiY)
        {
            Bitmap       bitmap       = null;
            Graphics     graphics     = null;
            Brush        brush        = null;
            Brush        brush2       = null;
            Pen          pen          = null;
            Pen          pen2         = null;
            Font         font         = null;
            MemoryStream memoryStream = new MemoryStream();

            try
            {
                bitmap = new Bitmap(width, height);
                bitmap.SetResolution(dpiX, dpiY);
                graphics = Graphics.FromImage(bitmap);
                brush    = new SolidBrush(Color.White);
                graphics.FillRectangle(brush, 0, 0, width, height);
                float num  = (float)MappingHelper.ToPixels(new ReportSize("1pt"), dpiX);
                float num2 = (float)MappingHelper.ToPixels(new ReportSize("1pt"), dpiY);
                pen  = new Pen(Color.Black, num);
                pen2 = new Pen(Color.Black, num2);
                graphics.DrawLine(pen, num, num2, (float)width - num, num2);
                graphics.DrawLine(pen2, (float)width - num, num2, (float)width - num, (float)height - num2);
                graphics.DrawLine(pen, (float)width - num, (float)height - num2, num, (float)height - num2);
                graphics.DrawLine(pen2, num, (float)height - num2, num, num2);
                brush2 = new SolidBrush(Color.Black);
                font   = MappingHelper.GetDefaultFont();
                graphics.DrawString(DynamicImageInstance.GetInnerMostException(exception).Message, font, brush2, new RectangleF(num, num2, (float)width - num, (float)height - num2));
                bitmap.Save(memoryStream, ImageFormat.Png);
                return(memoryStream);
            }
            catch (Exception ex)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(ex))
                {
                    throw;
                }
                Global.Tracer.Trace(TraceLevel.Verbose, ex.Message);
                return(null);
            }
            finally
            {
                if (brush != null)
                {
                    brush.Dispose();
                    brush = null;
                }
                if (pen != null)
                {
                    pen.Dispose();
                    pen = null;
                }
                if (pen2 != null)
                {
                    pen2.Dispose();
                    pen2 = null;
                }
                if (brush2 != null)
                {
                    brush2.Dispose();
                    brush2 = null;
                }
                if (font != null)
                {
                    font.Dispose();
                    font = null;
                }
                if (graphics != null)
                {
                    graphics.Dispose();
                    graphics = null;
                }
                if (bitmap != null)
                {
                    bitmap.Dispose();
                    bitmap = null;
                }
            }
        }
Exemplo n.º 11
0
 public static int ToIntPixels(double value, Unit unit, float dpi)
 {
     return(Convert.ToInt32(MappingHelper.ToPixels(value, unit, dpi)));
 }
Exemplo n.º 12
0
 public Font GetFontFromCache(int id, Style style, StyleInstance styleInstance)
 {
     return(this.GetFontFromCache(id, MappingHelper.GetStyleFontFamily(style, styleInstance, this.GetDefaultFont().Name), MappingHelper.GetStyleFontSize(style, styleInstance), MappingHelper.GetStyleFontStyle(style, styleInstance), MappingHelper.GetStyleFontWeight(style, styleInstance), MappingHelper.GetStyleFontTextDecoration(style, styleInstance)));
 }
Exemplo n.º 13
0
 public static Font GetDefaultFont()
 {
     return(new Font(MappingHelper.DefaultFontFamily, MappingHelper.DefaultFontSize, MappingHelper.GetStyleFontStyle(FontStyles.Normal, FontWeights.Normal, TextDecorations.None)));
 }
Exemplo n.º 14
0
 public static ActionInfoWithDynamicImageMap CreateActionInfoDynamic(ReportItem reportItem, ActionInfo actionInfo, string toolTip, out string href)
 {
     return(MappingHelper.CreateActionInfoDynamic(reportItem, actionInfo, toolTip, out href, true));
 }
Exemplo n.º 15
0
 public static int GetDefaultSize(float dpi)
 {
     return(MappingHelper.ToIntPixels(LineTemplateMapper.m_defaultLineWidth, dpi));
 }
Exemplo n.º 16
0
 public Font GetDefaultFont()
 {
     return(this.GetFont(this.m_defaultFontFamily, FontCache.m_defaultFontSize, MappingHelper.GetStyleFontStyle(FontStyles.Normal, FontWeights.Normal, TextDecorations.None)));
 }
Exemplo n.º 17
0
 public Font GetFontFromCache(int id, string fontFamily, float fontSize, FontStyles fontStyle, FontWeights fontWeight, TextDecorations textDecoration)
 {
     return(this.m_fontCache.GetFontFromCache(id, fontFamily, fontSize, MappingHelper.GetStyleFontStyle(fontStyle, fontWeight, textDecoration)));
 }
Exemplo n.º 18
0
 public static int ToIntPixels(ReportSize size, float dpi)
 {
     return(Convert.ToInt32(MappingHelper.ToPixels(size, dpi)));
 }
Exemplo n.º 19
0
 protected Font GetFont(Style style, StyleInstance styleInstance)
 {
     return(this.m_fontCache.GetFont(MappingHelper.GetStyleFontFamily(style, styleInstance, this.GetDefaultFont().Name), MappingHelper.GetStyleFontSize(style, styleInstance), MappingHelper.GetStyleFontStyle(MappingHelper.GetStyleFontStyle(style, styleInstance), MappingHelper.GetStyleFontWeight(style, styleInstance), MappingHelper.GetStyleFontTextDecoration(style, styleInstance))));
 }
Exemplo n.º 20
0
        public static double ConvertToDouble(object value, bool checkForMaxMinValue, bool checkForStringDate)
        {
            bool flag = false;

            return(MappingHelper.ConvertToDouble(value, checkForMaxMinValue, checkForStringDate, ref flag));
        }