internal static UnicodeBiDiTypes TranslateUnicodeBiDi(string styleString, IErrorContext errorContext)
 {
     if (styleString == null)
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumUnicodeBiDiType);
     }
     if (CompareWithInvariantCulture("Normal", styleString))
     {
         return(UnicodeBiDiTypes.Normal);
     }
     if (CompareWithInvariantCulture("Embed", styleString))
     {
         return(UnicodeBiDiTypes.Embed);
     }
     if (CompareWithInvariantCulture("BiDi-Override", styleString))
     {
         return(UnicodeBiDiTypes.BiDiOverride);
     }
     if (CompareWithInvariantCulture("BiDiOverride", styleString))
     {
         return(UnicodeBiDiTypes.BiDiOverride);
     }
     if (CompareWithInvariantCulture("Default", styleString))
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumUnicodeBiDiType);
     }
     errorContext?.Register(ProcessingErrorCode.rsInvalidUnicodeBiDi, Severity.Warning, styleString);
     return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumUnicodeBiDiType);
 }
 internal static TextEffects TranslateTextEffect(string styleValue, IErrorContext errorContext, bool isChartStyle)
 {
     if (styleValue != null && !CompareWithInvariantCulture(styleValue, "Default"))
     {
         if (CompareWithInvariantCulture(styleValue, "None"))
         {
             return(TextEffects.None);
         }
         if (CompareWithInvariantCulture(styleValue, "Shadow"))
         {
             return(TextEffects.Shadow);
         }
         if (CompareWithInvariantCulture(styleValue, "Emboss"))
         {
             return(TextEffects.Emboss);
         }
         if (CompareWithInvariantCulture(styleValue, "Embed"))
         {
             return(TextEffects.Embed);
         }
         if (CompareWithInvariantCulture(styleValue, "Frame"))
         {
             return(TextEffects.Frame);
         }
     }
     if (styleValue != null)
     {
         errorContext?.Register(ProcessingErrorCode.rsInvalidTextEffect, Severity.Warning, styleValue);
     }
     if (isChartStyle)
     {
         return(TextEffects.Shadow);
     }
     return(TextEffects.None);
 }
 internal static WritingModes TranslateWritingMode(string styleString, IErrorContext errorContext)
 {
     if (styleString == null)
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumWritingMode);
     }
     if (CompareWithInvariantCulture("lr-tb", styleString))
     {
         return(WritingModes.Horizontal);
     }
     if (CompareWithInvariantCulture("tb-rl", styleString))
     {
         return(WritingModes.Vertical);
     }
     if (CompareWithInvariantCulture("Horizontal", styleString))
     {
         return(WritingModes.Horizontal);
     }
     if (CompareWithInvariantCulture("Vertical", styleString))
     {
         return(WritingModes.Vertical);
     }
     if (CompareWithInvariantCulture("Rotate270", styleString))
     {
         return(WritingModes.Rotate270);
     }
     if (CompareWithInvariantCulture("Default", styleString))
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumWritingMode);
     }
     errorContext?.Register(ProcessingErrorCode.rsInvalidWritingMode, Severity.Warning, styleString);
     return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumWritingMode);
 }
 internal static VerticalAlignments TranslateVerticalAlign(string styleString, IErrorContext errorContext)
 {
     if (styleString == null)
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumVerticalAlignment);
     }
     if (CompareWithInvariantCulture("Top", styleString))
     {
         return(VerticalAlignments.Top);
     }
     if (CompareWithInvariantCulture("Middle", styleString))
     {
         return(VerticalAlignments.Middle);
     }
     if (CompareWithInvariantCulture("Bottom", styleString))
     {
         return(VerticalAlignments.Bottom);
     }
     if (CompareWithInvariantCulture("Default", styleString))
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumVerticalAlignment);
     }
     errorContext?.Register(ProcessingErrorCode.rsInvalidVerticalAlign, Severity.Warning, styleString);
     return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumVerticalAlignment);
 }
 internal static TextAlignments TranslateTextAlign(string styleString, IErrorContext errorContext)
 {
     if (styleString == null)
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextAlignment);
     }
     if (CompareWithInvariantCulture("General", styleString))
     {
         return(TextAlignments.General);
     }
     if (CompareWithInvariantCulture("Left", styleString))
     {
         return(TextAlignments.Left);
     }
     if (CompareWithInvariantCulture("Center", styleString))
     {
         return(TextAlignments.Center);
     }
     if (CompareWithInvariantCulture("Right", styleString))
     {
         return(TextAlignments.Right);
     }
     if (CompareWithInvariantCulture("Default", styleString))
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextAlignment);
     }
     errorContext?.Register(ProcessingErrorCode.rsInvalidTextAlign, Severity.Warning, styleString);
     return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextAlignment);
 }
 internal static TextDecorations TranslateTextDecoration(string styleString, IErrorContext errorContext)
 {
     if (styleString == null)
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextDecoration);
     }
     if (CompareWithInvariantCulture("None", styleString))
     {
         return(TextDecorations.None);
     }
     if (CompareWithInvariantCulture("Underline", styleString))
     {
         return(TextDecorations.Underline);
     }
     if (CompareWithInvariantCulture("Overline", styleString))
     {
         return(TextDecorations.Overline);
     }
     if (CompareWithInvariantCulture("LineThrough", styleString))
     {
         return(TextDecorations.LineThrough);
     }
     if (CompareWithInvariantCulture("Default", styleString))
     {
         return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextDecoration);
     }
     errorContext?.Register(ProcessingErrorCode.rsInvalidTextDecoration, Severity.Warning, styleString);
     return(Microsoft.ReportingServices.OnDemandReportRendering.Style.DefaultEnumTextDecoration);
 }
 internal static string ValidateColor(string color, IErrorContext errorContext, bool allowTransparency)
 {
     if (Validator.ValidateColor(color, out string newColor, allowTransparency))
     {
         return(newColor);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Warning, color);
     return(null);
 }
 public static string ValidateFontStyle(string fontStyle, IErrorContext errorContext)
 {
     if (Validator.ValidateFontStyle(fontStyle))
     {
         return(fontStyle);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidFontStyle, Severity.Warning, fontStyle);
     return(null);
 }
 public static string ValidateSpecificLanguage(string language, IErrorContext errorContext, out CultureInfo culture)
 {
     if (Validator.ValidateSpecificLanguage(language, out culture))
     {
         return(language);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidLanguage, Severity.Warning, language);
     return(null);
 }
 internal static string ValidateUnicodeBiDi(string unicodeBiDi, IErrorContext errorContext)
 {
     if (Validator.ValidateUnicodeBiDi(unicodeBiDi))
     {
         return(unicodeBiDi);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidUnicodeBiDi, Severity.Warning, unicodeBiDi);
     return(null);
 }
 internal static string ValidateCalendar(string calendar, IErrorContext errorContext)
 {
     if (Validator.ValidateCalendar(calendar))
     {
         return(calendar);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidCalendar, Severity.Warning, calendar);
     return(null);
 }
 internal static string ValidateBackgroundHatchType(string backgroundHatchType, IErrorContext errorContext)
 {
     if (Validator.ValidateBackgroundHatchType(backgroundHatchType))
     {
         return(backgroundHatchType);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidBackgroundHatchType, Severity.Warning, backgroundHatchType);
     return(null);
 }
 internal static string ValidateWritingMode(string writingMode, IErrorContext errorContext)
 {
     if (Validator.ValidateWritingMode(writingMode))
     {
         return(writingMode);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidWritingMode, Severity.Warning, writingMode);
     return(null);
 }
 public static string ValidateMimeType(string mimeType, IErrorContext errorContext)
 {
     if (Validator.ValidateMimeType(mimeType))
     {
         return(mimeType);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidMIMEType, Severity.Warning, mimeType);
     return(null);
 }
 internal static string ValidateVerticalAlign(string verticalAlign, IErrorContext errorContext)
 {
     if (Validator.ValidateVerticalAlign(verticalAlign))
     {
         return(verticalAlign);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidVerticalAlign, Severity.Warning, verticalAlign);
     return(null);
 }
 public static string ValidateBackgroundRepeat(string repeat, IErrorContext errorContext)
 {
     if (Validator.ValidateBackgroundRepeat(repeat))
     {
         return(repeat);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidBackgroundRepeat, Severity.Warning, repeat);
     return(null);
 }
 internal static string ValidateFontWeight(string fontWeight, IErrorContext errorContext)
 {
     if (Validator.ValidateFontWeight(fontWeight))
     {
         return(fontWeight);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidFontWeight, Severity.Warning, fontWeight);
     return(null);
 }
 internal static string ValidateParagraphListStyle(string value, IErrorContext errorContext)
 {
     if (Validator.ValidateParagraphListStyle(value))
     {
         return(value);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidListStyle, Severity.Warning, value);
     return("None");
 }
 internal static int?ValidateParagraphListLevel(int value, IErrorContext errorContext)
 {
     if (!Validator.ValidateParagraphListLevel(value, out int?adjustedValue))
     {
         errorContext.Register(ProcessingErrorCode.rsOutOfRangeSize, Severity.Warning, Convert.ToString(value, CultureInfo.InvariantCulture), Convert.ToString(0, CultureInfo.InvariantCulture), Convert.ToString(9, CultureInfo.InvariantCulture));
         return(adjustedValue);
     }
     return(value);
 }
 internal static string ValidateTextRunMarkupType(string value, IErrorContext errorContext)
 {
     if (Validator.ValidateTextRunMarkupType(value))
     {
         return(value);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidMarkupType, Severity.Warning, value);
     return("None");
 }
 internal static string ValidateBorderStyle(string borderStyle, ObjectType objectType, bool isDynamicImageSubElement, IErrorContext errorContext, bool isDefaultBorder)
 {
     if (!Validator.ValidateBorderStyle(borderStyle, isDefaultBorder, objectType, isDynamicImageSubElement, out string validatedStyle))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidBorderStyle, Severity.Warning, borderStyle);
         return(null);
     }
     return(validatedStyle);
 }
 internal static string ValidateTextEffect(string textEffect, IErrorContext errorContext)
 {
     if (Validator.ValidateTextEffect(textEffect))
     {
         return(textEffect);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidTextEffect, Severity.Warning, textEffect);
     return(null);
 }
 public static object ValidateNumeralVariant(int numeralVariant, IErrorContext errorContext)
 {
     if (Validator.ValidateNumeralVariant(numeralVariant))
     {
         return(numeralVariant);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidNumeralVariant, Severity.Warning, numeralVariant.ToString(CultureInfo.InvariantCulture));
     return(null);
 }
 internal static string ValidateTextDecoration(string textDecoration, IErrorContext errorContext)
 {
     if (Validator.ValidateTextDecoration(textDecoration))
     {
         return(textDecoration);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidTextDecoration, Severity.Warning, textDecoration);
     return(null);
 }
 public static string ValidateBackgroundGradientType(string gradientType, IErrorContext errorContext)
 {
     if (Validator.ValidateBackgroundGradientType(gradientType))
     {
         return(gradientType);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidBackgroundGradientType, Severity.Warning, gradientType);
     return(null);
 }
 internal static string ValidateDirection(string direction, IErrorContext errorContext)
 {
     if (Validator.ValidateDirection(direction))
     {
         return(direction);
     }
     errorContext.Register(ProcessingErrorCode.rsInvalidDirection, Severity.Warning, direction);
     return(null);
 }
Ejemplo n.º 27
0
        public override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            Global.Tracer.Assert(null != expressions);
            Global.Tracer.Assert(1 == expressions.Length);
            object       obj      = expressions[0];
            DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);

            if (!DataAggregate.IsNull(typeCode))
            {
                if (!DataAggregate.IsVariant(typeCode))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
                    throw new InvalidOperationException();
                }
                if (this.m_expressionType == DataTypeCode.Null)
                {
                    this.m_expressionType = typeCode;
                }
                else if (typeCode != this.m_expressionType)
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                    throw new InvalidOperationException();
                }
                if (this.m_currentMax == null)
                {
                    this.m_currentMax = obj;
                }
                else
                {
                    try
                    {
                        int num = ReportProcessing.CompareTo(this.m_currentMax, obj, this.m_compareInfo, this.m_compareOptions);
                        if (num < 0)
                        {
                            this.m_currentMax = obj;
                        }
                    }
                    catch
                    {
                        iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
                    }
                }
            }
        }
Ejemplo n.º 28
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            Global.Tracer.Assert(expressions != null);
            Global.Tracer.Assert(1 == expressions.Length);
            object       obj      = expressions[0];
            DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);

            if (DataAggregate.IsNull(typeCode))
            {
                return;
            }
            if (!DataAggregate.IsVariant(typeCode))
            {
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
                throw new InvalidOperationException();
            }
            if (m_expressionType == DataTypeCode.Null)
            {
                m_expressionType = typeCode;
            }
            else if (typeCode != m_expressionType)
            {
                iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                throw new InvalidOperationException();
            }
            if (m_currentMin == null)
            {
                m_currentMin = obj;
                return;
            }
            try
            {
                if (ReportProcessing.CompareTo(m_currentMin, obj, m_compareInfo, m_compareOptions) > 0)
                {
                    m_currentMin = obj;
                }
            }
            catch
            {
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
            }
        }
        public static int?ValidateParagraphListLevel(int value, IErrorContext errorContext)
        {
            int?result = default(int?);

            if (!Validator.ValidateParagraphListLevel(value, out result))
            {
                errorContext.Register(ProcessingErrorCode.rsOutOfRangeSize, Severity.Warning, Convert.ToString(value, CultureInfo.InvariantCulture), Convert.ToString(0, CultureInfo.InvariantCulture), Convert.ToString(9, CultureInfo.InvariantCulture));
                return(result);
            }
            return(value);
        }
        public static string ValidateColor(string color, IErrorContext errorContext, bool allowTransparency)
        {
            string result = default(string);

            if (Validator.ValidateColor(color, out result, allowTransparency))
            {
                return(result);
            }
            errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Warning, color);
            return(null);
        }