コード例 #1
0
        private void InternalPopulateNonSharedStyleProperties(StyleAttributeHashtable styleAttributes)
        {
            if (styleAttributes == null)
            {
                return;
            }
            IDictionaryEnumerator enumerator = styleAttributes.GetEnumerator();

            while (enumerator.MoveNext())
            {
                AttributeInfo attributeInfo = (AttributeInfo)enumerator.Value;
                string        text          = (string)enumerator.Key;
                if ("BackgroundImageSource" == text)
                {
                    if (GetBackgroundImageProperties(attributeInfo, styleAttributes["BackgroundImageValue"], styleAttributes["BackgroundImageMIMEType"], out Image.SourceType imageSource, out object imageValue, out bool isValueExpression, out object mimeType, out bool isMimeTypeExpression) && (isValueExpression || isMimeTypeExpression) && imageValue != null)
                    {
                        string mimeType2 = null;
                        if (!isMimeTypeExpression)
                        {
                            mimeType2 = (string)mimeType;
                        }
                        object styleProperty = new BackgroundImage(m_renderingContext, imageSource, imageValue, mimeType2);
                        SetStyleProperty("BackgroundImage", isExpression: true, needNonSharedProps: true, needSharedProps: false, styleProperty);
                    }
                }
                else if (!("BackgroundImageValue" == text) && !("BackgroundImageMIMEType" == text) && attributeInfo.IsExpression)
                {
                    SetStyleProperty(text, isExpression: true, needNonSharedProps: true, needSharedProps: false, CreateProperty(text, GetStyleAttributeValue(text, attributeInfo)));
                }
            }
        }
コード例 #2
0
 internal ShimBackgroundImageInstance(BackgroundImage backgroundImageDef, Microsoft.ReportingServices.ReportRendering.BackgroundImage renderImage, string backgroundRepeat)
     : base(null)
 {
     m_backgroundImageDef = backgroundImageDef;
     m_renderImage        = renderImage;
     m_backgroundRepeat   = StyleTranslator.TranslateBackgroundRepeat(backgroundRepeat, null, m_backgroundImageDef.StyleDef.IsDynamicImageStyle);
 }
コード例 #3
0
        internal override void PopulateStyleProperties(bool populateAll)
        {
            if (base.IsCustomControl)
            {
                return;
            }
            bool flag  = true;
            bool flag2 = false;

            if (populateAll)
            {
                flag  = NeedPopulateSharedProps();
                flag2 = NeedPopulateNonSharedProps();
                if (!flag && !flag2)
                {
                    return;
                }
            }
            Microsoft.ReportingServices.ReportProcessing.Style styleClass = m_actionInfo.ActionInfoDef.StyleClass;
            StyleAttributeHashtable styleAttributeHashtable = null;

            if (styleClass != null)
            {
                styleAttributeHashtable = styleClass.StyleAttributes;
            }
            Global.Tracer.Assert(styleAttributeHashtable != null);
            IDictionaryEnumerator enumerator = styleAttributeHashtable.GetEnumerator();

            while (enumerator.MoveNext())
            {
                AttributeInfo attributeInfo = (AttributeInfo)enumerator.Value;
                string        text          = (string)enumerator.Key;
                if ("BackgroundImage" == text)
                {
                    Image.SourceType imageSource          = Image.SourceType.External;
                    object           imageValue           = null;
                    object           mimeType             = null;
                    bool             isValueExpression    = false;
                    bool             isMimeTypeExpression = false;
                    GetBackgroundImageProperties(styleAttributeHashtable["BackgroundImageSource"], styleAttributeHashtable["BackgroundImageValue"], styleAttributeHashtable["BackgroundImageMIMEType"], out imageSource, out imageValue, out isValueExpression, out mimeType, out isMimeTypeExpression);
                    if (imageValue != null)
                    {
                        string mimeType2 = null;
                        if (!isMimeTypeExpression)
                        {
                            mimeType2 = (string)mimeType;
                        }
                        object styleProperty = new BackgroundImage(m_renderingContext, imageSource, imageValue, mimeType2);
                        AddStyleProperty(text, isValueExpression || isMimeTypeExpression, flag2, flag, styleProperty);
                    }
                }
                else if (!("BackgroundImageValue" == text) && !("BackgroundImageMIMEType" == text))
                {
                    AddStyleProperty(text, attributeInfo.IsExpression, flag2, flag, CreateProperty(text, GetStyleAttributeValue(text, attributeInfo)));
                }
            }
        }
コード例 #4
0
ファイル: Style.cs プロジェクト: zatuliveter/reportviewercore
        internal override void PopulateStyleProperties(bool populateAll)
        {
            if (base.IsCustomControl)
            {
                return;
            }
            bool flag  = true;
            bool flag2 = false;

            if (populateAll)
            {
                flag  = NeedPopulateSharedProps();
                flag2 = NeedPopulateNonSharedProps();
                if (!flag && !flag2)
                {
                    return;
                }
            }
            Microsoft.ReportingServices.ReportProcessing.Style styleClass = m_reportItemDef.StyleClass;
            StyleAttributeHashtable styleAttributeHashtable = null;

            if (styleClass != null)
            {
                styleAttributeHashtable = styleClass.StyleAttributes;
            }
            StyleAttributeHashtable styleAttributeHashtable2 = null;

            if (m_reportItem.HeadingInstance != null)
            {
                Global.Tracer.Assert(m_reportItem.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass != null);
                styleAttributeHashtable2 = m_reportItem.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass.StyleAttributes;
            }
            for (int i = 0; i < 42; i++)
            {
                string name = m_styleDefaults.GetName(i);
                if (styleAttributeHashtable == null && styleAttributeHashtable2 == null)
                {
                    AddStyleProperty(name, isExpression: false, flag2, flag, m_styleDefaults[i]);
                }
                else if (styleAttributeHashtable2 != null && styleAttributeHashtable2.ContainsKey(name))
                {
                    AttributeInfo attribute = styleAttributeHashtable2[name];
                    AddStyleProperty(name, isExpression: true, needNonSharedProps: true, needSharedProps: false, CreatePropertyOrReturnDefault(name, GetStyleAttributeValue(name, attribute)));
                }
                else if (styleAttributeHashtable != null && styleAttributeHashtable.ContainsKey(name))
                {
                    AttributeInfo attributeInfo = styleAttributeHashtable[name];
                    AddStyleProperty(name, attributeInfo.IsExpression, flag2, flag, CreatePropertyOrReturnDefault(name, GetStyleAttributeValue(name, attributeInfo)));
                }
                else if ("BackgroundImage" == name)
                {
                    Image.SourceType imageSource          = Image.SourceType.External;
                    object           imageValue           = null;
                    object           mimeType             = null;
                    bool             isValueExpression    = false;
                    bool             isMimeTypeExpression = false;
                    bool             flag3 = false;
                    if (styleAttributeHashtable2 != null)
                    {
                        flag3 = GetBackgroundImageProperties(styleAttributeHashtable2["BackgroundImageSource"], styleAttributeHashtable2["BackgroundImageValue"], styleAttributeHashtable2["BackgroundImageMIMEType"], out imageSource, out imageValue, out isValueExpression, out mimeType, out isMimeTypeExpression);
                    }
                    if (!flag3 && styleAttributeHashtable != null)
                    {
                        flag3 = GetBackgroundImageProperties(styleAttributeHashtable["BackgroundImageSource"], styleAttributeHashtable["BackgroundImageValue"], styleAttributeHashtable["BackgroundImageMIMEType"], out imageSource, out imageValue, out isValueExpression, out mimeType, out isMimeTypeExpression);
                    }
                    object styleProperty;
                    if (imageValue != null)
                    {
                        string mimeType2 = null;
                        if (!isMimeTypeExpression)
                        {
                            mimeType2 = (string)mimeType;
                        }
                        styleProperty = new BackgroundImage(m_renderingContext, imageSource, imageValue, mimeType2);
                    }
                    else
                    {
                        styleProperty = m_styleDefaults[i];
                    }
                    AddStyleProperty(name, isValueExpression || isMimeTypeExpression, flag2, flag, styleProperty);
                }
                else
                {
                    AddStyleProperty(name, isExpression: false, flag2, flag, m_styleDefaults[i]);
                }
            }
        }