protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_hueColor     = null;
     m_transparency = null;
     m_clipImage    = null;
 }
Example #2
0
 protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_hueColor = null;
     m_offsetX  = null;
     m_offsetY  = null;
 }
Example #3
0
 protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_startColor  = null;
     m_middleColor = null;
     m_endColor    = null;
 }
 protected override void ResetInstanceCache()
 {
     m_backgroundRepeatEvaluated = false;
     m_positionEvaluated         = false;
     m_transparentColorEvaluated = false;
     m_transparentColor          = null;
     m_imageDataHandler.ClearCache();
 }
Example #5
0
 protected override void ResetInstanceCache()
 {
     m_source           = null;
     m_transparentColor = null;
     if (m_imageDataHandler != null)
     {
         m_imageDataHandler.ClearCache();
     }
 }
Example #6
0
 public static bool TryParse(string value, bool allowTransparency, out ReportColor reportColor)
 {
     if (Validator.ValidateColor(value, out Color c, allowTransparency))
     {
         reportColor = new ReportColor(value, c, parsed: true);
         return(true);
     }
     reportColor = null;
     return(false);
 }
 protected override void ResetInstanceCache()
 {
     m_colorEvaluated = false;
     m_colorAssigned  = false;
     m_color          = null;
     m_styleEvaluated = false;
     m_styleAssigned  = false;
     m_widthEvaluated = false;
     m_widthAssigned  = false;
     m_width          = null;
 }
Example #8
0
 protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_layout = null;
     m_autoFitTextDisabled = null;
     m_minFontSize         = null;
     m_interlacedRows      = null;
     m_interlacedRowsColor = null;
     m_equallySpacedItems  = null;
     m_textWrapThreshold   = null;
 }
Example #9
0
 protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_tickMarkLength      = null;
     m_colorBarBorderColor = null;
     m_labelInterval       = null;
     m_labelFormat         = null;
     m_labelPlacement      = null;
     m_labelBehavior       = null;
     m_hideEndLabels       = null;
     m_rangeGapColor       = null;
     m_noDataText          = null;
 }
        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);
        }
        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 GetStyleBorderColor(Border border)
        {
            ReportColorProperty color = border.Color;
            Color color2 = Color.Black;

            if (!GetColorFromReportColorProperty(color, ref color2))
            {
                ReportColor color3 = border.Instance.Color;
                if (color3 != null)
                {
                    color2 = color3.ToColor();
                }
            }
            return(color2);
        }
Example #14
0
        private Color GetCustomColor(MapCustomColor mapCustomColor)
        {
            ReportColorProperty color = mapCustomColor.Color;
            Color color2 = Color.Empty;

            if (color != null)
            {
                if (MappingHelper.GetColorFromReportColorProperty(color, ref color2))
                {
                    return(color2);
                }
                ReportColor color3 = mapCustomColor.Instance.Color;
                if (color3 != null)
                {
                    return(color3.ToColor());
                }
            }
            return(color2);
        }
        internal void SetAssignedDynamicValue(BorderStyleProperty prop, Microsoft.ReportingServices.ReportIntermediateFormat.AttributeInfo value, bool allowTransparency)
        {
            switch (prop)
            {
            case BorderStyleProperty.Color:
                m_colorEvaluated = true;
                m_color          = new ReportColor(value.Value, allowTransparency);
                break;

            case BorderStyleProperty.Style:
                m_styleEvaluated = true;
                m_style          = (BorderStyles)value.IntValue;
                break;

            case BorderStyleProperty.Width:
                m_widthEvaluated = true;
                m_width          = new ReportSize(value.Value);
                break;
            }
        }
        private void ParseTextRunElement(HtmlElement.HtmlElementType elementType)
        {
            m_currentStyle = m_currentStyle.CreateChildStyle(elementType);
            bool flag = false;

            switch (m_currentHtmlElement.ElementType)
            {
            case HtmlElement.HtmlElementType.I:
            case HtmlElement.HtmlElementType.EM:
                m_currentStyle.FontStyle = FontStyles.Italic;
                break;

            case HtmlElement.HtmlElementType.U:
                m_currentStyle.TextDecoration = TextDecorations.Underline;
                break;

            case HtmlElement.HtmlElementType.STRONG:
            case HtmlElement.HtmlElementType.B:
                m_currentStyle.FontWeight = FontWeights.Bold;
                break;

            case HtmlElement.HtmlElementType.STRIKE:
            case HtmlElement.HtmlElementType.S:
                m_currentStyle.TextDecoration = TextDecorations.LineThrough;
                break;

            case HtmlElement.HtmlElementType.SPAN:
            case HtmlElement.HtmlElementType.FONT:
                flag = true;
                break;
            }
            if (!flag || m_currentHtmlElement.IsEmptyElement || !m_currentHtmlElement.HasAttributes)
            {
                return;
            }
            if (m_currentHtmlElement.ElementType == HtmlElement.HtmlElementType.FONT)
            {
                if (m_currentHtmlElement.Attributes.TryGetValue("size", out string value))
                {
                    if (RichTextStyleTranslator.TranslateHtmlFontSize(value, out string translatedSize))
                    {
                        m_currentStyle.FontSize = new ReportSize(translatedSize);
                    }
                    else
                    {
                        m_richTextLogger.RegisterInvalidSizeWarning("size", value, m_currentHtmlElement.CharacterPosition);
                    }
                }
                if (m_currentHtmlElement.Attributes.TryGetValue("face", out value))
                {
                    m_currentStyle.FontFamily = value;
                }
                if (m_currentHtmlElement.Attributes.TryGetValue("color", out value))
                {
                    if (ReportColor.TryParse(RichTextStyleTranslator.TranslateHtmlColor(value), out ReportColor reportColor))
                    {
                        m_currentStyle.Color = reportColor;
                    }
                    else
                    {
                        m_richTextLogger.RegisterInvalidColorWarning("color", value, m_currentHtmlElement.CharacterPosition);
                    }
                }
            }
            else if (m_currentHtmlElement.ElementType == HtmlElement.HtmlElementType.SPAN)
            {
                SetStyleValues(isParagraph: false);
            }
        }
Example #17
0
 protected override void ResetInstanceCache()
 {
     base.ResetInstanceCache();
     m_scaleColor       = null;
     m_scaleBorderColor = null;
 }
        private void SetStyleValues(bool isParagraph)
        {
            if (m_currentHtmlElement.CssStyle == null)
            {
                return;
            }
            string     value;
            ReportSize reportSize;

            if (isParagraph && m_allowMultipleParagraphs)
            {
                if (m_currentHtmlElement.CssStyle.TryGetValue("text-align", out value))
                {
                    if (RichTextStyleTranslator.TranslateTextAlign(value, out TextAlignments textAlignment))
                    {
                        m_currentStyle.TextAlign = textAlignment;
                    }
                    else
                    {
                        m_richTextLogger.RegisterInvalidValueWarning("text-align", value, m_currentHtmlElement.CharacterPosition);
                    }
                }
                if (m_currentHtmlElement.CssStyle.TryGetValue("text-indent", out value))
                {
                    if (ReportSize.TryParse(value, allowNegative: true, out reportSize))
                    {
                        m_currentParagraph.HangingIndent = reportSize;
                    }
                    else
                    {
                        m_richTextLogger.RegisterInvalidSizeWarning("text-indent", value, m_currentHtmlElement.CharacterPosition);
                    }
                }
                ReportSize generalPadding = null;
                if (m_currentHtmlElement.CssStyle.TryGetValue("padding", out value))
                {
                    if (ReportSize.TryParse(value, out reportSize))
                    {
                        generalPadding = reportSize;
                    }
                    else
                    {
                        m_richTextLogger.RegisterInvalidSizeWarning("padding", value, m_currentHtmlElement.CharacterPosition);
                    }
                }
                if (HasPaddingValue("padding-top", generalPadding, out ReportSize effectivePadding))
                {
                    m_currentParagraph.AddSpaceBefore(effectivePadding);
                }
                if (HasPaddingValue("padding-bottom", generalPadding, out effectivePadding))
                {
                    m_currentParagraph.AddSpaceAfter(effectivePadding);
                }
                if (HasPaddingValue("padding-left", generalPadding, out effectivePadding))
                {
                    m_currentParagraph.AddLeftIndent(effectivePadding);
                }
                if (HasPaddingValue("padding-right", generalPadding, out effectivePadding))
                {
                    m_currentParagraph.AddRightIndent(effectivePadding);
                }
            }
            if (m_currentHtmlElement.CssStyle.TryGetValue("font-family", out value))
            {
                m_currentStyle.FontFamily = value;
            }
            if (m_currentHtmlElement.CssStyle.TryGetValue("font-size", out value))
            {
                if (ReportSize.TryParse(value, out reportSize))
                {
                    m_currentStyle.FontSize = reportSize;
                }
                else
                {
                    m_richTextLogger.RegisterInvalidSizeWarning("font-size", value, m_currentHtmlElement.CharacterPosition);
                }
            }
            if (m_currentHtmlElement.CssStyle.TryGetValue("font-weight", out value))
            {
                if (RichTextStyleTranslator.TranslateFontWeight(value, out FontWeights fontWieght))
                {
                    m_currentStyle.FontWeight = fontWieght;
                }
                else
                {
                    m_richTextLogger.RegisterInvalidValueWarning("font-weight", value, m_currentHtmlElement.CharacterPosition);
                }
            }
            if (m_currentHtmlElement.CssStyle.TryGetValue("color", out value))
            {
                if (ReportColor.TryParse(RichTextStyleTranslator.TranslateHtmlColor(value), out ReportColor reportColor))
                {
                    m_currentStyle.Color = reportColor;
                }
                else
                {
                    m_richTextLogger.RegisterInvalidColorWarning("color", value, m_currentHtmlElement.CharacterPosition);
                }
            }
        }
Example #19
0
 public static bool TryParse(string value, out ReportColor reportColor)
 {
     return(TryParse(value, allowTransparency: false, out reportColor));
 }