Ejemplo n.º 1
0
        internal static byte?GetNonCompiledEnumProp(byte styleAttributeRplId, StyleAttributeNames styleAttributeName, Style style, StyleInstance styleIntance)
        {
            if (style == null)
            {
                return(null);
            }
            ReportProperty reportProperty = style[styleAttributeName];

            if (reportProperty == null)
            {
                return(null);
            }
            if (reportProperty.IsExpression)
            {
                if (styleIntance != null)
                {
                    object obj = styleIntance[styleAttributeName];
                    if (obj != null)
                    {
                        bool convertToString = false;
                        return(PageItem.GetStylePropByte(styleAttributeRplId, obj, ref convertToString));
                    }
                }
                return(null);
            }
            return(PageItem.GetStylePropByte(styleAttributeRplId, reportProperty));
        }
Ejemplo n.º 2
0
        public static byte?GetNonCompiledEnumProp(byte styleAttributeRplId, StyleAttributeNames styleAttributeName, Style style, StyleInstance styleIntance)
        {
            if (style == null)
            {
                return(null);
            }
            ReportProperty reportProperty = ((StyleBase)style)[styleAttributeName];

            if (reportProperty == null)
            {
                return(null);
            }
            if (reportProperty.IsExpression)
            {
                if (styleIntance != null)
                {
                    object obj = ((StyleBaseInstance)styleIntance)[styleAttributeName];
                    if (obj != null)
                    {
                        bool flag = false;
                        return(PageItem.GetStylePropByte(styleAttributeRplId, obj, ref flag));
                    }
                }
                return(null);
            }
            return(PageItem.GetStylePropByte(styleAttributeRplId, reportProperty));
        }
        protected override bool IsAvailableStyle(StyleAttributeNames styleName)
        {
            switch (styleName)
            {
            case StyleAttributeNames.BorderColor:
            case StyleAttributeNames.BorderColorTop:
            case StyleAttributeNames.BorderColorLeft:
            case StyleAttributeNames.BorderColorRight:
            case StyleAttributeNames.BorderColorBottom:
            case StyleAttributeNames.BorderStyle:
            case StyleAttributeNames.BorderStyleTop:
            case StyleAttributeNames.BorderStyleLeft:
            case StyleAttributeNames.BorderStyleRight:
            case StyleAttributeNames.BorderStyleBottom:
            case StyleAttributeNames.BorderWidth:
            case StyleAttributeNames.BorderWidthTop:
            case StyleAttributeNames.BorderWidthLeft:
            case StyleAttributeNames.BorderWidthRight:
            case StyleAttributeNames.BorderWidthBottom:
            case StyleAttributeNames.BackgroundColor:
            case StyleAttributeNames.VerticalAlign:
            case StyleAttributeNames.PaddingLeft:
            case StyleAttributeNames.PaddingRight:
            case StyleAttributeNames.PaddingTop:
            case StyleAttributeNames.PaddingBottom:
            case StyleAttributeNames.Direction:
            case StyleAttributeNames.WritingMode:
            case StyleAttributeNames.BackgroundImage:
            case StyleAttributeNames.BackgroundImageRepeat:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 4
0
        public static Color GetColorProp(byte rplId, StyleAttributeNames styleAttributeName, Color defaultColor, Style styleDef, Dictionary <byte, object> styles)
        {
            object obj = null;

            if (styles != null && styles.TryGetValue(rplId, out obj))
            {
                string text = obj as string;
                if (text != null)
                {
                    ReportColor reportColor = new ReportColor(text);
                    return(reportColor.ToColor());
                }
            }
            ReportColorProperty reportColorProperty = ((StyleBase)styleDef)[styleAttributeName] as ReportColorProperty;

            if (reportColorProperty != null && !reportColorProperty.IsExpression)
            {
                ReportColor value = reportColorProperty.Value;
                if (value != null)
                {
                    return(value.ToColor());
                }
            }
            return(defaultColor);
        }
 protected override bool IsAvailableStyle(StyleAttributeNames styleName)
 {
     if (styleName == StyleAttributeNames.TextAlign || styleName == StyleAttributeNames.LineHeight)
     {
         return(true);
     }
     return(false);
 }
        public static int TranslateStyle(StyleAttributeNames styleName, string styleString, IErrorContext errorContext, bool isChartStyle)
        {
            switch (styleName)
            {
            case StyleAttributeNames.BorderStyle:
            case StyleAttributeNames.BorderStyleTop:
            case StyleAttributeNames.BorderStyleLeft:
            case StyleAttributeNames.BorderStyleRight:
            case StyleAttributeNames.BorderStyleBottom:
                return((int)StyleTranslator.TranslateBorderStyle(styleString, errorContext));

            case StyleAttributeNames.BackgroundGradientType:
                return((int)StyleTranslator.TranslateBackgroundGradientType(styleString, errorContext));

            case StyleAttributeNames.BackgroundImageRepeat:
                return((int)StyleTranslator.TranslateBackgroundRepeat(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.FontStyle:
                return((int)StyleTranslator.TranslateFontStyle(styleString, errorContext));

            case StyleAttributeNames.FontWeight:
                return((int)StyleTranslator.TranslateFontWeight(styleString, errorContext));

            case StyleAttributeNames.TextDecoration:
                return((int)StyleTranslator.TranslateTextDecoration(styleString, errorContext));

            case StyleAttributeNames.TextAlign:
                return((int)StyleTranslator.TranslateTextAlign(styleString, errorContext));

            case StyleAttributeNames.VerticalAlign:
                return((int)StyleTranslator.TranslateVerticalAlign(styleString, errorContext));

            case StyleAttributeNames.Direction:
                return((int)StyleTranslator.TranslateDirection(styleString, errorContext));

            case StyleAttributeNames.WritingMode:
                return((int)StyleTranslator.TranslateWritingMode(styleString, errorContext));

            case StyleAttributeNames.UnicodeBiDi:
                return((int)StyleTranslator.TranslateUnicodeBiDi(styleString, errorContext));

            case StyleAttributeNames.Calendar:
                return((int)StyleTranslator.TranslateCalendar(styleString, errorContext));

            case StyleAttributeNames.TextEffect:
                return((int)StyleTranslator.TranslateTextEffect(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.BackgroundHatchType:
                return((int)StyleTranslator.TranslateBackgroundHatchType(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.Position:
                return((int)StyleTranslator.TranslatePosition(styleString, errorContext, isChartStyle));

            default:
                throw new NotImplementedException("cannot translate style: " + styleName.ToString());
            }
        }
Ejemplo n.º 7
0
        private double GetPaddings(StyleAttributeNames padd1, StyleAttributeNames padd2)
        {
            double     num        = 0.0;
            ReportSize styleValue = GetStyleValue(padd1);

            if (styleValue != null)
            {
                num += styleValue.ToMillimeters();
            }
            styleValue = GetStyleValue(padd2);
            if (styleValue != null)
            {
                num += styleValue.ToMillimeters();
            }
            return(num);
        }
Ejemplo n.º 8
0
        public static byte ConvertROMTORPL(StyleAttributeNames ROMType)
        {
            switch (ROMType)
            {
            case StyleAttributeNames.Color:
                return(27);

            case StyleAttributeNames.FontFamily:
                return(20);

            case StyleAttributeNames.FontSize:
                return(21);

            case StyleAttributeNames.FontStyle:
                return(19);

            case StyleAttributeNames.FontWeight:
                return(22);

            case StyleAttributeNames.TextDecoration:
                return(24);

            case StyleAttributeNames.Format:
                return(23);

            case StyleAttributeNames.Language:
                return(32);

            case StyleAttributeNames.NumeralLanguage:
                return(36);

            case StyleAttributeNames.NumeralVariant:
                return(37);

            case StyleAttributeNames.Calendar:
                return(38);

            case StyleAttributeNames.TextAlign:
                return(25);

            case StyleAttributeNames.LineHeight:
                return(28);

            default:
                return(0);
            }
        }
        private void CompleteStyle()
        {
            List <StyleAttributeNames>             styleAttributes = base.StyleAttributes;
            Dictionary <StyleAttributeNames, bool> dictionary      = null;

            if (styleAttributes != null)
            {
                dictionary = new Dictionary <StyleAttributeNames, bool>(styleAttributes.Count);
                foreach (StyleAttributeNames item in styleAttributes)
                {
                    dictionary[item] = true;
                }
            }
            else
            {
                m_nonSharedStyles = new List <StyleAttributeNames>();
            }
            if (m_assignedValues != null)
            {
                foreach (KeyValuePair <StyleAttributeNames, bool> assignedValue in m_assignedValues)
                {
                    if (assignedValue.Value)
                    {
                        StyleAttributeNames key = assignedValue.Key;
                        if (dictionary == null)
                        {
                            m_nonSharedStyles.Add(key);
                        }
                        else
                        {
                            dictionary[key] = true;
                        }
                    }
                }
            }
            if (dictionary == null)
            {
                return;
            }
            m_nonSharedStyles = new List <StyleAttributeNames>(dictionary.Count);
            foreach (StyleAttributeNames key2 in dictionary.Keys)
            {
                m_nonSharedStyles.Add(key2);
            }
        }
Ejemplo n.º 10
0
        private ReportSize GetStyleValue(StyleAttributeNames styleName)
        {
            object         obj            = null;
            ReportProperty reportProperty = m_source.Style[styleName];

            if (reportProperty != null)
            {
                if (reportProperty.IsExpression)
                {
                    obj = GetStyleInstance(m_source, null)[styleName];
                }
                if (obj == null)
                {
                    obj = ((ReportSizeProperty)reportProperty).Value;
                }
            }
            return(obj as ReportSize);
        }
Ejemplo n.º 11
0
        private ReportSize GetStyleValue(StyleAttributeNames styleName)
        {
            object         obj            = null;
            ReportProperty reportProperty = ((StyleBase)base.m_source.Style)[styleName];

            if (reportProperty != null)
            {
                if (reportProperty.IsExpression)
                {
                    StyleInstance styleInstance = base.GetStyleInstance(base.m_source, null);
                    obj = ((StyleBaseInstance)styleInstance)[styleName];
                }
                if (obj == null)
                {
                    obj = ((ReportSizeProperty)reportProperty).Value;
                }
            }
            return(obj as ReportSize);
        }
Ejemplo n.º 12
0
        private static ReportSize GetStyleValue(StyleAttributeNames styleName, ref bool shared, ReportItem source)
        {
            object         obj            = null;
            ReportProperty reportProperty = source.Style[styleName];

            if (reportProperty != null)
            {
                if (reportProperty.IsExpression)
                {
                    shared = false;
                    obj    = source.Instance.Style[styleName];
                }
                if (obj == null)
                {
                    obj = ((ReportSizeProperty)reportProperty).Value;
                }
            }
            return(obj as ReportSize);
        }
Ejemplo n.º 13
0
        internal static string GetStringProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object value = null;

            if (styles != null && styles.TryGetValue(rplId, out value))
            {
                string text = value as string;
                if (text != null)
                {
                    return(text);
                }
            }
            ReportStringProperty reportStringProperty = styleDef[styleAttributeName] as ReportStringProperty;

            if (reportStringProperty != null && !reportStringProperty.IsExpression)
            {
                return(reportStringProperty.Value);
            }
            return(null);
        }
Ejemplo n.º 14
0
        internal static byte?GetEnumProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object value = null;

            if (styles != null && styles.TryGetValue(rplId, out value))
            {
                byte?b = value as byte?;
                if (b.HasValue)
                {
                    return(b.Value);
                }
            }
            ReportProperty reportProperty = styleDef[styleAttributeName];

            if (reportProperty != null && !reportProperty.IsExpression)
            {
                return(PageItem.GetStylePropByte(rplId, reportProperty));
            }
            return(null);
        }
Ejemplo n.º 15
0
        internal static double GetSizeProp(byte rplId, StyleAttributeNames styleAttributeName, float defaultValue, Style styleDef, Dictionary <byte, object> styles)
        {
            object value = null;

            if (styles != null && styles.TryGetValue(rplId, out value))
            {
                string text = value as string;
                if (text != null)
                {
                    return(new RPLReportSize(text).ToPoints());
                }
            }
            ReportSizeProperty reportSizeProperty = styleDef[styleAttributeName] as ReportSizeProperty;

            if (reportSizeProperty != null && !reportSizeProperty.IsExpression && reportSizeProperty.Value != null)
            {
                return(reportSizeProperty.Value.ToPoints());
            }
            return(defaultValue);
        }
Ejemplo n.º 16
0
        public static string GetStringProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object obj = null;

            if (styles != null && styles.TryGetValue(rplId, out obj))
            {
                string text = obj as string;
                if (text != null)
                {
                    return(text);
                }
            }
            ReportStringProperty reportStringProperty = ((StyleBase)styleDef)[styleAttributeName] as ReportStringProperty;

            if (reportStringProperty != null && !reportStringProperty.IsExpression)
            {
                return(reportStringProperty.Value);
            }
            return(null);
        }
Ejemplo n.º 17
0
        public static byte?GetEnumProp(byte rplId, StyleAttributeNames styleAttributeName, Style styleDef, Dictionary <byte, object> styles)
        {
            object obj = null;

            if (styles != null && styles.TryGetValue(rplId, out obj))
            {
                byte?nullable  = (byte?)(object)(obj as byte?);
                int? nullable2 = nullable;
                if (nullable2.HasValue)
                {
                    return(nullable.Value);
                }
            }
            ReportProperty reportProperty = ((StyleBase)styleDef)[styleAttributeName];

            if (reportProperty != null && !reportProperty.IsExpression)
            {
                return(PageItem.GetStylePropByte(rplId, reportProperty));
            }
            return(null);
        }
Ejemplo n.º 18
0
        public static double GetSizeProp(byte rplId, StyleAttributeNames styleAttributeName, float defaultValue, Style styleDef, Dictionary <byte, object> styles)
        {
            object obj = null;

            if (styles != null && styles.TryGetValue(rplId, out obj))
            {
                string text = obj as string;
                if (text != null)
                {
                    RPLReportSize rPLReportSize = new RPLReportSize(text);
                    return(rPLReportSize.ToPoints());
                }
            }
            ReportSizeProperty reportSizeProperty = ((StyleBase)styleDef)[styleAttributeName] as ReportSizeProperty;

            if (reportSizeProperty != null && !reportSizeProperty.IsExpression && reportSizeProperty.Value != null)
            {
                return(reportSizeProperty.Value.ToPoints());
            }
            return((double)defaultValue);
        }
        protected override bool IsAvailableStyle(StyleAttributeNames styleName)
        {
            switch (styleName)
            {
            case StyleAttributeNames.FontStyle:
            case StyleAttributeNames.FontFamily:
            case StyleAttributeNames.FontSize:
            case StyleAttributeNames.FontWeight:
            case StyleAttributeNames.Format:
            case StyleAttributeNames.TextDecoration:
            case StyleAttributeNames.Color:
            case StyleAttributeNames.Language:
            case StyleAttributeNames.Calendar:
            case StyleAttributeNames.NumeralLanguage:
            case StyleAttributeNames.NumeralVariant:
            case StyleAttributeNames.CurrencyLanguage:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 20
0
        internal static Color GetColorProp(byte rplId, StyleAttributeNames styleAttributeName, Color defaultColor, Style styleDef, Dictionary <byte, object> styles)
        {
            object value = null;

            if (styles != null && styles.TryGetValue(rplId, out value))
            {
                string text = value as string;
                if (text != null)
                {
                    return(new ReportColor(text).ToColor());
                }
            }
            ReportColorProperty reportColorProperty = styleDef[styleAttributeName] as ReportColorProperty;

            if (reportColorProperty != null && !reportColorProperty.IsExpression)
            {
                ReportColor value2 = reportColorProperty.Value;
                if (value2 != null)
                {
                    return(value2.ToColor());
                }
            }
            return(defaultColor);
        }
 public abstract object this[StyleAttributeNames style]
 {
     get;
 }
Ejemplo n.º 22
0
 internal override void WriteItemNonSharedStyleProp(BinaryWriter spbifWriter, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (styleAttribute == StyleAttributeNames.BackgroundColor)
     {
         WriteStyleProp(styleDef, style, spbifWriter, StyleAttributeNames.BackgroundColor, 34);
     }
 }
Ejemplo n.º 23
0
 internal override void WriteNonSharedStyleProp(BinaryWriter spbifWriter, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (!SpecialBorderHandling)
     {
         base.WriteNonSharedStyleProp(spbifWriter, styleDef, style, styleAttribute, pageContext);
     }
     else
     {
         WriteItemNonSharedStyleProp(spbifWriter, styleDef, style, styleAttribute, pageContext);
     }
 }
Ejemplo n.º 24
0
        internal override void WriteNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
        {
            switch (styleAttribute)
            {
            case StyleAttributeNames.TextAlign:
                WriteStyleProp(styleDef, style, rplStyleProps, styleAttribute, 25);
                break;

            case StyleAttributeNames.LineHeight:
                WriteStyleProp(styleDef, style, rplStyleProps, styleAttribute, 28);
                break;
            }
        }
Ejemplo n.º 25
0
 internal object GetRichTextStyleValue(StyleAttributeNames styleName)
 {
     return(GetRichTextStyleValue(styleName, m_compiledSource));
 }
Ejemplo n.º 26
0
 internal object GetRichTextStyleValue(StyleAttributeNames styleName, ref bool isShared)
 {
     return(GetRichTextStyleValue(styleName, m_compiledSource, ref isShared));
 }
Ejemplo n.º 27
0
 public object GetRichTextStyleValue(StyleAttributeNames styleName)
 {
     return(base.GetRichTextStyleValue(styleName, this.m_compiledSource));
 }
Ejemplo n.º 28
0
 public override void WriteNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (!this.SpecialBorderHandling)
     {
         base.WriteNonSharedStyleProp(rplStyleProps, styleDef, style, styleAttribute, pageContext);
     }
     else
     {
         this.WriteItemNonSharedStyleProp(rplStyleProps, styleDef, style, styleAttribute, pageContext);
     }
 }
Ejemplo n.º 29
0
 public override void WriteItemNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (styleAttribute == StyleAttributeNames.BackgroundColor)
     {
         base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.BackgroundColor, 34);
     }
 }
Ejemplo n.º 30
0
        public override void WriteNonSharedStyleProp(BinaryWriter spbifWriter, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
        {
            switch (styleAttribute)
            {
            case StyleAttributeNames.TextAlign:
                base.WriteStyleProp(styleDef, style, spbifWriter, styleAttribute, 25);
                break;

            case StyleAttributeNames.LineHeight:
                base.WriteStyleProp(styleDef, style, spbifWriter, styleAttribute, 28);
                break;
            }
        }