public static string ValidatePadding(string size, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateSize(size, Validator.PaddingMin, Validator.PaddingMax, false, errorContext));
 }
 public static string ValidateLineHeight(string size, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateSize(size, Validator.LineHeightMin, Validator.LineHeightMax, false, errorContext));
 }
 public static string ValidateFontSize(string size, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateSize(size, Validator.FontSizeMin, Validator.FontSizeMax, false, errorContext));
 }
 public static string ValidateBorderWidth(string size, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateSize(size, Validator.BorderWidthMin, Validator.BorderWidthMax, false, errorContext));
 }
 public static string ValidateSize(string size, bool allowNegative, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateSize(size, -1.7976931348623157E+308, 1.7976931348623157E+308, allowNegative, errorContext));
 }
        public static object ValidateCustomStyle(string styleName, object styleValue, ObjectType objectType, IErrorContext errorContext)
        {
            CultureInfo cultureInfo = default(CultureInfo);

            switch (styleName)
            {
            case "BorderColor":
            case "BorderColorLeft":
            case "BorderColorRight":
            case "BorderColorTop":
            case "BorderColorBottom":
                return(ProcessingValidator.ValidateColor(styleValue as string, errorContext, Validator.IsDynamicImageReportItem(objectType)));

            case "BorderStyle":
                return(ProcessingValidator.ValidateBorderStyle(styleValue as string, objectType, false, errorContext, true));

            case "BorderStyleLeft":
            case "BorderStyleRight":
            case "BorderStyleTop":
            case "BorderStyleBottom":
                return(ProcessingValidator.ValidateBorderStyle(styleValue as string, objectType, false, errorContext, false));

            case "BorderWidth":
            case "BorderWidthLeft":
            case "BorderWidthRight":
            case "BorderWidthTop":
            case "BorderWidthBottom":
                return(ProcessingValidator.ValidateSize((styleValue as ReportSize).ToString(), Validator.BorderWidthMin, Validator.BorderWidthMax, false, errorContext));

            case "Color":
            case "BackgroundColor":
            case "BackgroundGradientEndColor":
                return(ProcessingValidator.ValidateColor(styleValue as string, errorContext, Validator.IsDynamicImageReportItem(objectType)));

            case "BackgroundGradientType":
                return(ProcessingValidator.ValidateBackgroundGradientType(styleValue as string, errorContext));

            case "FontStyle":
                return(ProcessingValidator.ValidateFontStyle(styleValue as string, errorContext));

            case "FontFamily":
                return(styleValue as string);

            case "FontSize":
                return(ProcessingValidator.ValidateSize((styleValue as ReportSize).ToString(), Validator.FontSizeMin, Validator.FontSizeMax, false, errorContext));

            case "FontWeight":
                return(ProcessingValidator.ValidateFontWeight(styleValue as string, errorContext));

            case "Format":
                return(styleValue as string);

            case "TextDecoration":
                return(ProcessingValidator.ValidateTextDecoration(styleValue as string, errorContext));

            case "TextAlign":
                return(ProcessingValidator.ValidateTextAlign(styleValue as string, errorContext));

            case "VerticalAlign":
                return(ProcessingValidator.ValidateVerticalAlign(styleValue as string, errorContext));

            case "PaddingLeft":
            case "PaddingRight":
            case "PaddingTop":
            case "PaddingBottom":
                return(ProcessingValidator.ValidateSize((styleValue as ReportSize).ToString(), Validator.PaddingMin, Validator.PaddingMax, false, errorContext));

            case "LineHeight":
                return(ProcessingValidator.ValidateSize((styleValue as ReportSize).ToString(), Validator.LineHeightMin, Validator.LineHeightMax, false, errorContext));

            case "Direction":
                return(ProcessingValidator.ValidateDirection(styleValue as string, errorContext));

            case "WritingMode":
                return(ProcessingValidator.ValidateWritingMode(styleValue as string, errorContext));

            case "Language":
                return(ProcessingValidator.ValidateSpecificLanguage(styleValue as string, errorContext, out cultureInfo));

            case "UnicodeBiDi":
                return(ProcessingValidator.ValidateUnicodeBiDi(styleValue as string, errorContext));

            case "Calendar":
                return(ProcessingValidator.ValidateCalendar(styleValue as string, errorContext));

            case "CurrencyLanguage":
                return(ProcessingValidator.ValidateLanguage(styleValue as string, errorContext, out cultureInfo));

            case "NumeralLanguage":
                return(ProcessingValidator.ValidateLanguage(styleValue as string, errorContext, out cultureInfo));

            case "NumeralVariant":
            {
                int numeralVariant = default(int);
                if (int.TryParse(styleValue as string, out numeralVariant))
                {
                    return(ProcessingValidator.ValidateNumeralVariant(numeralVariant, errorContext));
                }
                errorContext.Register(ProcessingErrorCode.rsInvalidNumeralVariant, Severity.Warning, styleValue as string);
                return(null);
            }

            default:
                Global.Tracer.Assert(false);
                break;

            case "BackgroundImageSource":
            case "BackgroundImageValue":
            case "BackgroundImageMIMEType":
            case "BackgroundRepeat":
                break;
            }
            return(null);
        }
 public static object ValidateCustomStyle(string styleName, object styleValue, IErrorContext errorContext)
 {
     return(ProcessingValidator.ValidateCustomStyle(styleName, styleValue, ObjectType.Image, errorContext));
 }