internal void FromColorScale(X14.ColorScale cs)
        {
            SetAllNull();

            SLConditionalFormattingValueObject2010 cfvo;
            SLColor clr;

            using (var oxr = OpenXmlReader.Create(cs))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(X14.ConditionalFormattingValueObject))
                    {
                        cfvo = new SLConditionalFormattingValueObject2010();
                        cfvo.FromConditionalFormattingValueObject(
                            (X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement());
                        Cfvos.Add(cfvo);
                    }
                    else if (oxr.ElementType == typeof(X14.Color))
                    {
                        clr = new SLColor(new List <Color>(), new List <Color>());
                        clr.FromExcel2010Color((X14.Color)oxr.LoadCurrentElement());
                        Colors.Add(clr);
                    }
                }
            }
        }
        internal SLConditionalFormattingValueObject2010 Clone()
        {
            var cfvo = new SLConditionalFormattingValueObject2010();

            cfvo.Formula            = Formula;
            cfvo.Type               = Type;
            cfvo.GreaterThanOrEqual = GreaterThanOrEqual;

            return(cfvo);
        }
        internal void FromIconSet(X14.IconSet ics)
        {
            SetAllNull();

            if (ics.IconSetTypes != null)
            {
                IconSetType = ics.IconSetTypes.Value;
            }
            if (ics.ShowValue != null)
            {
                ShowValue = ics.ShowValue.Value;
            }
            if (ics.Percent != null)
            {
                Percent = ics.Percent.Value;
            }
            if (ics.Reverse != null)
            {
                Reverse = ics.Reverse.Value;
            }

            using (var oxr = OpenXmlReader.Create(ics))
            {
                SLConditionalFormattingValueObject2010 cfvo;
                SLConditionalFormattingIcon2010        cfi;
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(X14.ConditionalFormattingValueObject))
                    {
                        cfvo = new SLConditionalFormattingValueObject2010();
                        cfvo.FromConditionalFormattingValueObject(
                            (X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement());
                        Cfvos.Add(cfvo);
                    }
                    else if (oxr.ElementType == typeof(X14.ConditionalFormattingIcon))
                    {
                        cfi = new SLConditionalFormattingIcon2010();
                        cfi.FromConditionalFormattingIcon((X14.ConditionalFormattingIcon)oxr.LoadCurrentElement());
                        CustomIcons.Add(cfi);
                    }
                }
            }
        }
        private void SetAllNull()
        {
            Cfvo1               = new SLConditionalFormattingValueObject2010();
            Cfvo2               = new SLConditionalFormattingValueObject2010();
            FillColor           = new SLColor(new List <Color>(), new List <Color>());
            BorderColor         = new SLColor(new List <Color>(), new List <Color>());
            NegativeFillColor   = new SLColor(new List <Color>(), new List <Color>());
            NegativeBorderColor = new SLColor(new List <Color>(), new List <Color>());
            AxisColor           = new SLColor(new List <Color>(), new List <Color>());

            MinLength = 10;
            MaxLength = 90;
            ShowValue = true;
            Border    = false;
            Gradient  = true;
            Direction = X14.DataBarDirectionValues.Context;
            NegativeBarColorSameAsPositive       = false;
            NegativeBarBorderColorSameAsPositive = true;
            AxisPosition = X14.DataBarAxisPositionValues.Automatic;
        }