예제 #1
0
        public void Initialize(InitializationContext context)
        {
            Global.Tracer.Assert(null != this.m_styleAttributes, "(null != m_styleAttributes)");
            IDictionaryEnumerator dictionaryEnumerator = (IDictionaryEnumerator)(object)this.m_styleAttributes.GetEnumerator();

            while (dictionaryEnumerator.MoveNext())
            {
                string        text          = (string)dictionaryEnumerator.Key;
                AttributeInfo attributeInfo = (AttributeInfo)dictionaryEnumerator.Value;
                Global.Tracer.Assert(null != text, "(null != name)");
                Global.Tracer.Assert(null != attributeInfo, "(null != attribute)");
                if (attributeInfo.IsExpression)
                {
                    string name = text;
                    switch (text)
                    {
                    case "BorderColorLeft":
                    case "BorderColorRight":
                    case "BorderColorTop":
                    case "BorderColorBottom":
                        text = "BorderColor";
                        break;

                    case "BorderStyleLeft":
                    case "BorderStyleRight":
                    case "BorderStyleTop":
                    case "BorderStyleBottom":
                        text = "BorderStyle";
                        break;

                    case "BorderWidthLeft":
                    case "BorderWidthRight":
                    case "BorderWidthTop":
                    case "BorderWidthBottom":
                        text = "BorderWidth";
                        break;
                    }
                    Global.Tracer.Assert(null != this.m_expressionList, "(null != m_expressionList)");
                    ExpressionInfo expressionInfo = this.m_expressionList[attributeInfo.IntValue];
                    expressionInfo.Initialize(text, context);
                    context.ExprHostBuilder.StyleAttribute(name, expressionInfo);
                }
            }
            AttributeInfo attributeInfo2 = default(AttributeInfo);

            this.m_styleAttributes.TryGetValue("BackgroundImageSource", out attributeInfo2);
            if (attributeInfo2 != null)
            {
                Global.Tracer.Assert(!attributeInfo2.IsExpression, "(!source.IsExpression)");
                AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType intValue = (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType)attributeInfo2.IntValue;
                AttributeInfo attributeInfo3 = default(AttributeInfo);
                if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Embedded == intValue && (!this.m_styleAttributes.TryGetValue("EmbeddingMode", out attributeInfo3) || attributeInfo3.IntValue != 1))
                {
                    AttributeInfo attributeInfo4 = this.m_styleAttributes["BackgroundImageValue"];
                    Global.Tracer.Assert(null != attributeInfo4, "(null != embeddedImageName)");
                    AspNetCore.ReportingServices.ReportPublishing.PublishingValidator.ValidateEmbeddedImageName(attributeInfo4, context.EmbeddedImages, context.ObjectType, context.ObjectName, "BackgroundImageValue", context.ErrorContext);
                }
            }
            context.CheckInternationalSettings(this.m_styleAttributes);
        }
예제 #2
0
        internal void Initialize(InitializationContext context)
        {
            Global.Tracer.Assert(m_styleAttributes != null, "(null != m_styleAttributes)");
            IDictionaryEnumerator dictionaryEnumerator = m_styleAttributes.GetEnumerator();

            while (dictionaryEnumerator.MoveNext())
            {
                string        text          = (string)dictionaryEnumerator.Key;
                AttributeInfo attributeInfo = (AttributeInfo)dictionaryEnumerator.Value;
                Global.Tracer.Assert(text != null, "(null != name)");
                Global.Tracer.Assert(attributeInfo != null, "(null != attribute)");
                if (attributeInfo.IsExpression)
                {
                    string name = text;
                    switch (text)
                    {
                    case "BorderColorLeft":
                    case "BorderColorRight":
                    case "BorderColorTop":
                    case "BorderColorBottom":
                        text = "BorderColor";
                        break;

                    case "BorderStyleLeft":
                    case "BorderStyleRight":
                    case "BorderStyleTop":
                    case "BorderStyleBottom":
                        text = "BorderStyle";
                        break;

                    case "BorderWidthLeft":
                    case "BorderWidthRight":
                    case "BorderWidthTop":
                    case "BorderWidthBottom":
                        text = "BorderWidth";
                        break;
                    }
                    Global.Tracer.Assert(m_expressionList != null, "(null != m_expressionList)");
                    ExpressionInfo expressionInfo = m_expressionList[attributeInfo.IntValue];
                    expressionInfo.Initialize(text, context);
                    context.ExprHostBuilder.StyleAttribute(name, expressionInfo);
                }
            }
            m_styleAttributes.TryGetValue("BackgroundImageSource", out AttributeInfo value);
            if (value != null)
            {
                Global.Tracer.Assert(!value.IsExpression, "(!source.IsExpression)");
                Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType intValue = (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType)value.IntValue;
                if (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType.Embedded == intValue && (!m_styleAttributes.TryGetValue("EmbeddingMode", out AttributeInfo value2) || value2.IntValue != 1))
                {
                    AttributeInfo attributeInfo2 = m_styleAttributes["BackgroundImageValue"];
                    Global.Tracer.Assert(attributeInfo2 != null, "(null != embeddedImageName)");
                    Microsoft.ReportingServices.ReportPublishing.PublishingValidator.ValidateEmbeddedImageName(attributeInfo2, context.EmbeddedImages, context.ObjectType, context.ObjectName, "BackgroundImageValue", context.ErrorContext);
                }
            }
            context.CheckInternationalSettings(m_styleAttributes);
        }
예제 #3
0
        public void Initialize(InitializationContext context)
        {
            Global.Tracer.Assert(null != this.m_styleAttributes);
            IDictionaryEnumerator enumerator = this.m_styleAttributes.GetEnumerator();

            while (enumerator.MoveNext())
            {
                string        text          = (string)enumerator.Key;
                AttributeInfo attributeInfo = (AttributeInfo)enumerator.Value;
                Global.Tracer.Assert(null != text);
                Global.Tracer.Assert(null != attributeInfo);
                if (attributeInfo.IsExpression)
                {
                    string name = text;
                    switch (text)
                    {
                    case "BorderColorLeft":
                    case "BorderColorRight":
                    case "BorderColorTop":
                    case "BorderColorBottom":
                        text = "BorderColor";
                        break;

                    case "BorderStyleLeft":
                    case "BorderStyleRight":
                    case "BorderStyleTop":
                    case "BorderStyleBottom":
                        text = "BorderStyle";
                        break;

                    case "BorderWidthLeft":
                    case "BorderWidthRight":
                    case "BorderWidthTop":
                    case "BorderWidthBottom":
                        text = "BorderWidth";
                        break;
                    }
                    Global.Tracer.Assert(null != this.m_expressionList);
                    ExpressionInfo expressionInfo = this.m_expressionList[attributeInfo.IntValue];
                    expressionInfo.Initialize(text, context);
                    context.ExprHostBuilder.StyleAttribute(name, expressionInfo);
                }
            }
            AttributeInfo attributeInfo2 = this.m_styleAttributes["BackgroundImageSource"];

            if (attributeInfo2 != null)
            {
                Global.Tracer.Assert(!attributeInfo2.IsExpression);
                Image.SourceType intValue = (Image.SourceType)attributeInfo2.IntValue;
                if (Image.SourceType.Embedded == intValue)
                {
                    AttributeInfo attributeInfo3 = this.m_styleAttributes["BackgroundImageValue"];
                    Global.Tracer.Assert(null != attributeInfo3);
                    PublishingValidator.ValidateEmbeddedImageName(attributeInfo3, context.EmbeddedImages, context.ObjectType, context.ObjectName, "BackgroundImageValue", context.ErrorContext);
                }
                else if (intValue == Image.SourceType.External)
                {
                    AttributeInfo attributeInfo4 = this.m_styleAttributes["BackgroundImageValue"];
                    Global.Tracer.Assert(null != attributeInfo4);
                    if (!attributeInfo4.IsExpression)
                    {
                        context.ImageStreamNames[attributeInfo4.Value] = new ImageInfo(context.ObjectName, null);
                    }
                }
            }
            context.CheckInternationalSettings(this.m_styleAttributes);
        }