예제 #1
0
 internal Sorting(ConstructionPhase phase)
 {
     if (phase == ConstructionPhase.Publishing)
     {
         m_sortExpressions = new ExpressionInfoList();
         m_sortDirections  = new BoolList();
     }
 }
예제 #2
0
 internal Grouping(ConstructionPhase phase)
 {
     if (phase == ConstructionPhase.Publishing)
     {
         m_groupExpressions    = new ExpressionInfoList();
         m_aggregates          = new DataAggregateInfoList();
         m_postSortAggregates  = new DataAggregateInfoList();
         m_recursiveAggregates = new DataAggregateInfoList();
     }
 }
예제 #3
0
        internal void AddAttribute(string name, ExpressionInfo expressionInfo)
        {
            AttributeInfo attributeInfo = new AttributeInfo();

            attributeInfo.IsExpression = (ExpressionInfo.Types.Constant != expressionInfo.Type);
            if (attributeInfo.IsExpression)
            {
                if (m_expressionList == null)
                {
                    m_expressionList = new ExpressionInfoList();
                }
                attributeInfo.IntValue = m_expressionList.Add(expressionInfo);
            }
            else
            {
                attributeInfo.Value     = expressionInfo.Value;
                attributeInfo.BoolValue = expressionInfo.BoolValue;
                attributeInfo.IntValue  = expressionInfo.IntValue;
            }
            Global.Tracer.Assert(m_styleAttributes != null);
            m_styleAttributes.Add(name, attributeInfo);
        }
예제 #4
0
 internal ChartDataPoint()
 {
     m_dataValues = new ExpressionInfoList();
 }
        internal static Style ValidateAndCreateStyle(StringList names, ExpressionInfoList values, ObjectType objectType, string objectName, ErrorContext errorContext)
        {
            Style style = new Style(ConstructionPhase.Publishing);

            Global.Tracer.Assert(names != null);
            Global.Tracer.Assert(values != null);
            Global.Tracer.Assert(names.Count == values.Count);
            ExpressionInfo backgroundImageSource   = null;
            ExpressionInfo backgroundImageValue    = null;
            ExpressionInfo backgroundImageMIMEType = null;

            for (int i = 0; i < names.Count; i++)
            {
                switch (names[i])
                {
                case "BackgroundImageSource":
                    backgroundImageSource = values[i];
                    break;

                case "BackgroundImageValue":
                    backgroundImageValue = values[i];
                    break;

                case "BackgroundImageMIMEType":
                    backgroundImageMIMEType = values[i];
                    break;

                case "BackgroundRepeat":
                    if (ValidateBackgroundRepeat(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "BorderColor":
                case "BorderColorLeft":
                case "BorderColorRight":
                case "BorderColorTop":
                case "BorderColorBottom":
                    if (ValidateColor(values[i], objectType, objectName, "BorderColor", errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "BorderStyle":
                case "BorderStyleLeft":
                case "BorderStyleRight":
                case "BorderStyleTop":
                case "BorderStyleBottom":
                    if (ValidateBorderStyle(values[i], objectType, objectName, "BorderStyle", errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "BorderWidth":
                case "BorderWidthLeft":
                case "BorderWidthRight":
                case "BorderWidthTop":
                case "BorderWidthBottom":
                    if (ValidateSize(values[i], Validator.BorderWidthMin, Validator.BorderWidthMax, objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "BackgroundColor":
                case "BackgroundGradientEndColor":
                    if (ValidateColor(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "BackgroundGradientType":
                    if (ValidateBackgroundGradientType(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "FontStyle":
                    if (ValidateFontStyle(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "FontFamily":
                    style.AddAttribute(names[i], values[i]);
                    break;

                case "FontSize":
                    if (ValidateSize(values[i], Validator.FontSizeMin, Validator.FontSizeMax, objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "FontWeight":
                    if (ValidateFontWeight(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "Format":
                    style.AddAttribute(names[i], values[i]);
                    break;

                case "TextDecoration":
                    if (ValidateTextDecoration(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "TextAlign":
                    if (ValidateTextAlign(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "VerticalAlign":
                    if (ValidateVerticalAlign(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "Color":
                    if (ValidateColor(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "PaddingLeft":
                case "PaddingRight":
                case "PaddingTop":
                case "PaddingBottom":
                    if (ValidateSize(values[i], Validator.PaddingMin, Validator.PaddingMax, objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "LineHeight":
                    if (ValidateSize(values[i], Validator.LineHeightMin, Validator.LineHeightMax, objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "Direction":
                    if (ValidateDirection(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "WritingMode":
                    if (ValidateWritingMode(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "Language":
                {
                    if (ValidateSpecificLanguage(values[i], objectType, objectName, names[i], errorContext, out CultureInfo _))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;
                }

                case "UnicodeBiDi":
                    if (ValidateUnicodeBiDi(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "Calendar":
                    if (ValidateCalendar(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "NumeralLanguage":
                    if (ValidateLanguage(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                case "NumeralVariant":
                    if (ValidateNumeralVariant(values[i], objectType, objectName, names[i], errorContext))
                    {
                        style.AddAttribute(names[i], values[i]);
                    }
                    break;

                default:
                    Global.Tracer.Assert(condition: false);
                    break;
                }
            }
            ValidateBackgroundImage(backgroundImageSource, backgroundImageValue, backgroundImageMIMEType, style, objectType, objectName, errorContext);
            if (0 < style.StyleAttributes.Count)
            {
                return(style);
            }
            return(null);
        }