示例#1
0
 internal override object GetStyleAttributeValue(string styleName, AttributeInfo attribute)
 {
     if (m_reportItem.HeadingInstance != null)
     {
         Microsoft.ReportingServices.ReportProcessing.Style styleClass = m_reportItem.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass;
         Global.Tracer.Assert(styleClass != null);
         AttributeInfo attributeInfo = styleClass.StyleAttributes[styleName];
         if (attributeInfo != null)
         {
             if (attributeInfo.IsExpression)
             {
                 MatrixSubtotalHeadingInstanceInfo matrixSubtotalHeadingInstanceInfo = m_reportItem.HeadingInstance.GetInstanceInfo(m_reportItem.RenderingContext.ChunkManager) as MatrixSubtotalHeadingInstanceInfo;
                 Global.Tracer.Assert(matrixSubtotalHeadingInstanceInfo != null);
                 Global.Tracer.Assert(matrixSubtotalHeadingInstanceInfo.StyleAttributeValues != null);
                 Global.Tracer.Assert(0 <= attributeInfo.IntValue && attributeInfo.IntValue < matrixSubtotalHeadingInstanceInfo.StyleAttributeValues.Length);
                 return(matrixSubtotalHeadingInstanceInfo.StyleAttributeValues[attributeInfo.IntValue]);
             }
             if ("NumeralVariant" == styleName)
             {
                 return(attributeInfo.IntValue);
             }
             return(attributeInfo.Value);
         }
     }
     if (attribute.IsExpression)
     {
         return(m_reportItem.InstanceInfo?.GetStyleAttributeValue(attribute.IntValue));
     }
     if ("NumeralVariant" == styleName)
     {
         return(attribute.IntValue);
     }
     return(attribute.Value);
 }
示例#2
0
 internal static object GetStyleValueBase(string styleName, Microsoft.ReportingServices.ReportProcessing.Style styleDef, object[] styleAttributeValues)
 {
     if (styleDef != null)
     {
         AttributeInfo attributeInfo = styleDef.StyleAttributes[styleName];
         if (attributeInfo != null)
         {
             object obj = null;
             if (!attributeInfo.IsExpression)
             {
                 obj = ((!("NumeralVariant" == styleName)) ? attributeInfo.Value : ((object)attributeInfo.IntValue));
             }
             else if (styleAttributeValues != null)
             {
                 Global.Tracer.Assert(0 <= attributeInfo.IntValue && attributeInfo.IntValue < styleAttributeValues.Length);
                 obj = styleAttributeValues[attributeInfo.IntValue];
             }
             else
             {
                 obj = null;
             }
             if (obj != null)
             {
                 return(CreateStyleProperty(styleName, obj));
             }
         }
     }
     return(null);
 }
示例#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
 private void PopulateNonSharedStyleProperties()
 {
     if (!base.IsCustomControl)
     {
         Microsoft.ReportingServices.ReportProcessing.Style styleClass = m_actionInfo.ActionInfoDef.StyleClass;
         if (styleClass != null)
         {
             StyleAttributeHashtable styleAttributes = styleClass.StyleAttributes;
             Global.Tracer.Assert(styleAttributes != null);
             InternalPopulateNonSharedStyleProperties(styleAttributes);
         }
     }
 }
示例#5
0
        internal static object GetStyleValue(string styleName, Microsoft.ReportingServices.ReportProcessing.Style styleDef, object[] styleAttributeValues, bool returnDefaultStyle)
        {
            object styleValueBase = StyleBase.GetStyleValueBase(styleName, styleDef, styleAttributeValues);

            if (styleValueBase != null)
            {
                return(styleValueBase);
            }
            if (returnDefaultStyle)
            {
                return(NormalStyleDefaults[styleName]);
            }
            return(null);
        }
示例#6
0
 private void PopulateNonSharedStyleProperties()
 {
     if (!base.IsCustomControl)
     {
         Microsoft.ReportingServices.ReportProcessing.Style styleClass = m_reportItemDef.StyleClass;
         if (styleClass != null)
         {
             StyleAttributeHashtable styleAttributes = styleClass.StyleAttributes;
             Global.Tracer.Assert(styleAttributes != null);
             InternalPopulateNonSharedStyleProperties(styleAttributes, isSubtotal: false);
         }
         if (m_reportItem.HeadingInstance != null)
         {
             Global.Tracer.Assert(m_reportItem.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass != null);
             StyleAttributeHashtable styleAttributes2 = m_reportItem.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass.StyleAttributes;
             InternalPopulateNonSharedStyleProperties(styleAttributes2, isSubtotal: true);
         }
     }
 }
        internal void Deconstruct(int uniqueName, ref Microsoft.ReportingServices.ReportProcessing.Action action, out ActionInstance actionInstance, Microsoft.ReportingServices.ReportProcessing.CustomReportItem context)
        {
            Global.Tracer.Assert(IsCustomControl && context != null);
            actionInstance = null;
            if (Processing.m_actionCollection == null || Processing.m_actionCollection.Count == 0)
            {
                if (action == null)
                {
                    return;
                }
                Global.Tracer.Assert(action.ActionItems != null && 0 < action.ActionItems.Count);
                int count = action.ActionItems.Count;
                actionInstance                   = new ActionInstance();
                actionInstance.UniqueName        = uniqueName;
                actionInstance.ActionItemsValues = new ActionItemInstanceList(count);
                for (int i = 0; i < count; i++)
                {
                    ActionItemInstance actionItemInstance = new ActionItemInstance();
                    if (action.ActionItems[i].DrillthroughParameters != null)
                    {
                        int count2 = action.ActionItems[i].DrillthroughParameters.Count;
                        actionItemInstance.DrillthroughParametersValues = new object[count2];
                        actionItemInstance.DrillthroughParametersOmits  = new BoolList(count2);
                    }
                    actionInstance.ActionItemsValues.Add(actionItemInstance);
                }
                return;
            }
            bool flag   = action == null;
            int  count3 = Processing.m_actionCollection.Count;

            Global.Tracer.Assert(1 <= count3);
            if (flag)
            {
                action             = new Microsoft.ReportingServices.ReportProcessing.Action();
                action.ActionItems = new ActionItemList(count3);
                action.ComputedActionItemsCount = count3;
            }
            else if (count3 != action.ComputedActionItemsCount)
            {
                context.ProcessingContext.ErrorContext.Register(ProcessingErrorCode.rsCRIRenderItemProperties, Severity.Error, context.CustomObjectType, context.CustomObjectName, context.Type, context.Name, "Actions", action.ComputedActionItemsCount.ToString(CultureInfo.InvariantCulture), count3.ToString(CultureInfo.InvariantCulture));
                throw new ReportProcessingException(context.ProcessingContext.ErrorContext.Messages);
            }
            actionInstance                   = new ActionInstance();
            actionInstance.UniqueName        = uniqueName;
            actionInstance.ActionItemsValues = new ActionItemInstanceList(count3);
            for (int j = 0; j < count3; j++)
            {
                Action     action2    = Processing.m_actionCollection[j];
                ActionItem actionItem = null;
                if (flag)
                {
                    actionItem = new ActionItem();
                    actionItem.ComputedIndex = j;
                    actionItem.Label         = new ExpressionInfo(ExpressionInfo.Types.Expression);
                    switch (action2.m_actionType)
                    {
                    case ActionType.HyperLink:
                        actionItem.HyperLinkURL = new ExpressionInfo(ExpressionInfo.Types.Expression);
                        break;

                    case ActionType.DrillThrough:
                        actionItem.DrillthroughReportName = new ExpressionInfo(ExpressionInfo.Types.Expression);
                        if (action2.m_parameters != null && 0 < action2.m_parameters.Count)
                        {
                            int count4 = action2.m_parameters.Count;
                            actionItem.DrillthroughParameters = new ParameterValueList(count4);
                            for (int k = 0; k < count4; k++)
                            {
                                ParameterValue parameterValue = new ParameterValue();
                                parameterValue.Name           = action2.m_parameters.GetKey(k);
                                parameterValue.Omit           = new ExpressionInfo(ExpressionInfo.Types.Constant);
                                parameterValue.Omit.BoolValue = false;
                                parameterValue.Value          = new ExpressionInfo(ExpressionInfo.Types.Expression);
                                actionItem.DrillthroughParameters.Add(parameterValue);
                            }
                        }
                        break;

                    case ActionType.BookmarkLink:
                        actionItem.BookmarkLink = new ExpressionInfo(ExpressionInfo.Types.Expression);
                        break;
                    }
                    action.ActionItems.Add(actionItem);
                }
                else
                {
                    actionItem = action.ActionItems[j];
                }
                Global.Tracer.Assert(actionItem != null);
                ActionItemInstance actionItemInstance2 = new ActionItemInstance();
                actionItemInstance2.Label = action2.Processing.m_label;
                switch (action2.m_actionType)
                {
                case ActionType.HyperLink:
                    actionItemInstance2.HyperLinkURL = action2.Processing.m_action;
                    break;

                case ActionType.DrillThrough:
                    actionItemInstance2.DrillthroughReportName = action2.Processing.m_action;
                    if (action2.m_parameters != null)
                    {
                        int count5 = action2.m_parameters.Count;
                        if (actionItem.DrillthroughParameters == null && 0 < count5)
                        {
                            context.ProcessingContext.ErrorContext.Register(ProcessingErrorCode.rsCRIRenderItemProperties, Severity.Error, context.CustomObjectType, context.CustomObjectName, context.Type, context.Name, "Action.DrillthroughParameters", "0", count5.ToString(CultureInfo.InvariantCulture));
                            throw new ReportProcessingException(context.ProcessingContext.ErrorContext.Messages);
                        }
                        if (count5 != actionItem.DrillthroughParameters.Count)
                        {
                            context.ProcessingContext.ErrorContext.Register(ProcessingErrorCode.rsCRIRenderItemProperties, Severity.Error, context.CustomObjectType, context.CustomObjectName, context.Type, context.Name, "Action.DrillthroughParameters", actionItem.DrillthroughParameters.Count.ToString(CultureInfo.InvariantCulture), count5.ToString(CultureInfo.InvariantCulture));
                            throw new ReportProcessingException(context.ProcessingContext.ErrorContext.Messages);
                        }
                        Global.Tracer.Assert(0 < count5);
                        actionItemInstance2.DrillthroughParametersValues = new object[count5];
                        actionItemInstance2.DrillthroughParametersOmits  = new BoolList(count5);
                        DrillthroughParameters drillthroughParameters = new DrillthroughParameters(count5);
                        for (int l = 0; l < count5; l++)
                        {
                            actionItemInstance2.DrillthroughParametersValues[l] = action2.m_parameters.GetValues(l);
                            actionItemInstance2.DrillthroughParametersOmits.Add(false);
                            drillthroughParameters.Add(actionItem.DrillthroughParameters[l].Name, actionItemInstance2.DrillthroughParametersValues[l]);
                        }
                        DrillthroughInformation drillthroughInfo = new DrillthroughInformation(actionItemInstance2.DrillthroughReportName, drillthroughParameters, null);
                        string drillthroughId = uniqueName.ToString(CultureInfo.InvariantCulture) + ":" + j.ToString(CultureInfo.InvariantCulture);
                        context.ProcessingContext.DrillthroughInfo.AddDrillthrough(drillthroughId, drillthroughInfo);
                    }
                    break;

                case ActionType.BookmarkLink:
                    actionItemInstance2.BookmarkLink = action2.Processing.m_action;
                    break;
                }
                actionInstance.ActionItemsValues.Add(actionItemInstance2);
            }
            Global.Tracer.Assert(action != null && actionInstance != null && Processing.m_actionCollection != null);
            Microsoft.ReportingServices.ReportProcessing.Style style = action.StyleClass;
            object[] styleAttributeValues = null;
            Microsoft.ReportingServices.ReportProcessing.CustomReportItem.DeconstructRenderStyle(flag, Processing.m_sharedStyles, Processing.m_nonSharedStyles, ref style, out styleAttributeValues, context);
            action.StyleClass = style;
            actionInstance.StyleAttributeValues = styleAttributeValues;
        }
示例#8
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_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]);
                }
            }
        }
示例#9
0
 internal static object GetStyleValue(string styleName, Microsoft.ReportingServices.ReportProcessing.Style styleDef, object[] styleAttributeValues)
 {
     return(GetStyleValue(styleName, styleDef, styleAttributeValues, returnDefaultStyle: true));
 }