Ejemplo n.º 1
0
        public static bool ValidateSize(string size, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
        {
            double num  = default(double);
            string text = default(string);

            return(PublishingValidator.ValidateSize(size, false, Validator.NegativeMin, Validator.NormalMax, objectType, objectName, propertyName, errorContext, out num, out text));
        }
Ejemplo n.º 2
0
        public static bool ValidateSize(string size, ObjectType objectType, string objectName, string propertyName, bool restrictMaxValue, bool allowNegative, ErrorContext errorContext, out double sizeInMM, out string roundSize)
        {
            double minValue = allowNegative ? Validator.NegativeMin : Validator.NormalMin;
            double maxValue = restrictMaxValue ? Validator.NormalMax : 1.7976931348623157E+308;

            return(PublishingValidator.ValidateSize(size, allowNegative, minValue, maxValue, objectType, objectName, propertyName, errorContext, out sizeInMM, out roundSize));
        }
Ejemplo n.º 3
0
        public double ValidateSize(string size, string propertyName, ErrorContext errorContext)
        {
            double result = default(double);
            string text   = default(string);

            PublishingValidator.ValidateSize(size, this.m_objectType, this.m_objectName, propertyName, true, errorContext, out result, out text);
            return(result);
        }
Ejemplo n.º 4
0
 public static bool ValidateEmbeddedImageName(AspNetCore.ReportingServices.ReportIntermediateFormat.AttributeInfo embeddedImageName, Dictionary <string, AspNetCore.ReportingServices.ReportIntermediateFormat.ImageInfo> embeddedImages, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(null != embeddedImageName);
     if (!embeddedImageName.IsExpression)
     {
         return(PublishingValidator.ValidateEmbeddedImageName(embeddedImageName.Value, embeddedImages, objectType, objectName, propertyName, errorContext));
     }
     return(true);
 }
Ejemplo n.º 5
0
 public static bool ValidateSize(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo size, double minValue, double maxValue, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(null != size);
     if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == size.Type)
     {
         bool   allowNegative = false;
         double num           = default(double);
         string text          = default(string);
         return(PublishingValidator.ValidateSize(size.StringValue, allowNegative, minValue, maxValue, objectType, objectName, propertyName, errorContext, out num, out text));
     }
     return(true);
 }
Ejemplo n.º 6
0
 public static bool ValidateMimeType(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo mimeType, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     if (mimeType == null)
     {
         errorContext.Register(ProcessingErrorCode.rsMissingMIMEType, Severity.Error, objectType, objectName, propertyName);
         return(false);
     }
     if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == mimeType.Type)
     {
         return(PublishingValidator.ValidateMimeType(mimeType.StringValue, objectType, objectName, propertyName, errorContext));
     }
     return(true);
 }
Ejemplo n.º 7
0
 public static bool ValidateColor(StyleInformation.StyleInformationAttribute colorAttribute, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     if (colorAttribute.ValueType == AspNetCore.ReportingServices.ReportIntermediateFormat.ValueType.ThemeReference)
     {
         string stringValue = colorAttribute.Value.StringValue;
         if (string.IsNullOrEmpty(stringValue))
         {
             errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Error, objectType, objectName, propertyName, stringValue);
             return(false);
         }
         return(true);
     }
     return(PublishingValidator.ValidateColor(colorAttribute.Value, objectType, objectName, propertyName, errorContext));
 }
Ejemplo n.º 8
0
        public static bool ValidateSize(string size, ObjectType objectType, string objectName, string propertyName, bool restrictMaxValue, ErrorContext errorContext, out double sizeInMM, out string roundSize)
        {
            bool allowNegative = ObjectType.Line == objectType;

            return(PublishingValidator.ValidateSize(size, objectType, objectName, propertyName, restrictMaxValue, allowNegative, errorContext, out sizeInMM, out roundSize));
        }
Ejemplo n.º 9
0
        public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, bool isDynamicImageSubElement, ErrorContext errorContext, bool checkForMeDotValue, out bool meDotValueReferenced)
        {
            meDotValueReferenced = false;
            AspNetCore.ReportingServices.ReportIntermediateFormat.Style style = new AspNetCore.ReportingServices.ReportIntermediateFormat.Style(AspNetCore.ReportingServices.ReportIntermediateFormat.ConstructionPhase.Publishing);
            Global.Tracer.Assert(null != attributes);
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageSource   = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageValue    = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageMIMEType = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundEmbeddingMode = null;
            for (int i = 0; i < attributes.Count; i++)
            {
                StyleInformation.StyleInformationAttribute styleInformationAttribute = attributes[i];
                if (checkForMeDotValue && styleInformationAttribute.ValueType == AspNetCore.ReportingServices.ReportIntermediateFormat.ValueType.Constant && styleInformationAttribute.Value.MeDotValueDetected)
                {
                    meDotValueReferenced = true;
                }
                switch (attributes[i].Name)
                {
                case "BackgroundImageSource":
                    backgroundImageSource = styleInformationAttribute.Value;
                    break;

                case "BackgroundImageValue":
                    backgroundImageValue = styleInformationAttribute.Value;
                    break;

                case "BackgroundImageMIMEType":
                    backgroundImageMIMEType = styleInformationAttribute.Value;
                    break;

                case "BackgroundRepeat":
                    if (PublishingValidator.ValidateBackgroundRepeat(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "EmbeddingMode":
                    backgroundEmbeddingMode = styleInformationAttribute.Value;
                    break;

                case "Transparency":
                    if (PublishingValidator.ValidateTransparency(styleInformationAttribute.Value, objectType, objectName, "Transparency", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TransparentColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "TransparentColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderColor":
                case "BorderColorLeft":
                case "BorderColorRight":
                case "BorderColorTop":
                case "BorderColorBottom":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "BorderColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderStyle":
                    if (PublishingValidator.ValidateBorderStyle(styleInformationAttribute.Value, objectType, objectName, isDynamicImageSubElement, "BorderStyle", true, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderStyleLeft":
                case "BorderStyleRight":
                case "BorderStyleTop":
                case "BorderStyleBottom":
                    if (PublishingValidator.ValidateBorderStyle(styleInformationAttribute.Value, objectType, objectName, isDynamicImageSubElement, "BorderStyle", false, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderWidth":
                case "BorderWidthLeft":
                case "BorderWidthRight":
                case "BorderWidthTop":
                case "BorderWidthBottom":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.BorderWidthMin, Validator.BorderWidthMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundGradientEndColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundGradientType":
                    if (PublishingValidator.ValidateBackgroundGradientType(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontStyle":
                    if (PublishingValidator.ValidateFontStyle(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontFamily":
                    style.AddAttribute(styleInformationAttribute);
                    break;

                case "FontSize":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.FontSizeMin, Validator.FontSizeMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontWeight":
                    if (PublishingValidator.ValidateFontWeight(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Format":
                    style.AddAttribute(styleInformationAttribute);
                    break;

                case "TextDecoration":
                    if (PublishingValidator.ValidateTextDecoration(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TextAlign":
                    if (PublishingValidator.ValidateTextAlign(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "VerticalAlign":
                    if (PublishingValidator.ValidateVerticalAlign(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Color":
                case "BackgroundColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "PaddingLeft":
                case "PaddingRight":
                case "PaddingTop":
                case "PaddingBottom":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.PaddingMin, Validator.PaddingMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "LineHeight":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.LineHeightMin, Validator.LineHeightMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Direction":
                    if (PublishingValidator.ValidateDirection(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "WritingMode":
                    if (PublishingValidator.ValidateWritingMode(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Language":
                {
                    CultureInfo cultureInfo = default(CultureInfo);
                    if (PublishingValidator.ValidateSpecificLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext, out cultureInfo))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;
                }

                case "UnicodeBiDi":
                    if (PublishingValidator.ValidateUnicodeBiDi(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Calendar":
                    if (PublishingValidator.ValidateCalendar(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "CurrencyLanguage":
                    if (PublishingValidator.ValidateLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "NumeralLanguage":
                    if (PublishingValidator.ValidateLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "NumeralVariant":
                    if (PublishingValidator.ValidateNumeralVariant(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "ShadowColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "ShadowColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "ShadowOffset":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.NormalMin, Validator.NormalMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundHatchType":
                    if (PublishingValidator.ValidateBackgroundHatchType(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TextEffect":
                    if (PublishingValidator.ValidateTextEffect(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Position":
                    if (PublishingValidator.ValidatePosition(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
            PublishingValidator.ValidateBackgroundImage(backgroundImageSource, backgroundImageValue, backgroundImageMIMEType, backgroundEmbeddingMode, style, objectType, objectName, errorContext);
            if (0 < style.StyleAttributes.Count)
            {
                return(style);
            }
            return(null);
        }
Ejemplo n.º 10
0
 public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, ErrorContext errorContext, bool checkForMeDotValue, out bool meDotValueReferenced)
 {
     return(PublishingValidator.ValidateAndCreateStyle(attributes, objectType, objectName, false, errorContext, checkForMeDotValue, out meDotValueReferenced));
 }
Ejemplo n.º 11
0
        public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, bool isDynamicImageSubElement, ErrorContext errorContext)
        {
            bool flag = default(bool);

            return(PublishingValidator.ValidateAndCreateStyle(attributes, objectType, objectName, isDynamicImageSubElement, errorContext, false, out flag));
        }
Ejemplo n.º 12
0
 private static void ValidateBackgroundImage(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageSource, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageValue, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageMIMEType, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundEmbeddingMode, AspNetCore.ReportingServices.ReportIntermediateFormat.Style style, ObjectType objectType, string objectName, ErrorContext errorContext)
 {
     if (backgroundImageSource != null)
     {
         bool flag = true;
         Global.Tracer.Assert(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageSource.Type);
         AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType intValue = (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType)backgroundImageSource.IntValue;
         Global.Tracer.Assert(null != backgroundImageValue);
         if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageValue.Type)
         {
             errorContext.Register(ProcessingErrorCode.rsBinaryConstant, Severity.Error, objectType, objectName, "BackgroundImageValue");
             flag = false;
         }
         if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && !PublishingValidator.ValidateMimeType(backgroundImageMIMEType, objectType, objectName, "BackgroundImageMIMEType", errorContext))
         {
             flag = false;
         }
         if (flag)
         {
             style.AddAttribute("BackgroundImageSource", backgroundImageSource);
             style.AddAttribute("BackgroundImageValue", backgroundImageValue);
             if (backgroundEmbeddingMode != null)
             {
                 style.AddAttribute("EmbeddingMode", backgroundEmbeddingMode);
             }
             if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue)
             {
                 style.AddAttribute("BackgroundImageMIMEType", backgroundImageMIMEType);
             }
         }
     }
 }