Exemplo n.º 1
0
        internal IconSet ToIconSet()
        {
            IconSet ics = new IconSet();

            if (this.IconSetType != SLIconSetValues.ThreeTrafficLights1)
            {
                ics.IconSetValue = SLIconSet.TranslateInternalSetToIconSet(this.IconSetType);
            }
            if (!this.ShowValue)
            {
                ics.ShowValue = this.ShowValue;
            }
            if (!this.Percent)
            {
                ics.Percent = this.Percent;
            }
            if (this.Reverse)
            {
                ics.Reverse = this.Reverse;
            }

            foreach (SLConditionalFormatValueObject cfvo in this.Cfvos)
            {
                ics.Append(cfvo.ToConditionalFormatValueObject());
            }

            return(ics);
        }
Exemplo n.º 2
0
        internal void FromIconSet(IconSet ics)
        {
            this.SetAllNull();

            if (ics.IconSetValue != null)
            {
                this.IconSetType = SLIconSet.TranslateIconSetToInternalSet(ics.IconSetValue.Value);
            }
            if (ics.ShowValue != null)
            {
                this.ShowValue = ics.ShowValue.Value;
            }
            if (ics.Percent != null)
            {
                this.Percent = ics.Percent.Value;
            }
            if (ics.Reverse != null)
            {
                this.Reverse = ics.Reverse.Value;
            }

            using (OpenXmlReader oxr = OpenXmlReader.Create(ics))
            {
                SLConditionalFormatValueObject cfvo;
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(ConditionalFormatValueObject))
                    {
                        cfvo = new SLConditionalFormatValueObject();
                        cfvo.FromConditionalFormatValueObject((ConditionalFormatValueObject)oxr.LoadCurrentElement());
                        this.Cfvos.Add(cfvo);
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal SLIconSet Clone()
        {
            SLIconSet ics = new SLIconSet();
            ics.Cfvos = new List<SLConditionalFormatValueObject>();
            for (int i = 0; i < this.Cfvos.Count; ++i)
            {
                ics.Cfvos.Add(this.Cfvos[i].Clone());
            }

            ics.IconSetValue = this.IconSetValue;
            ics.ShowValue = this.ShowValue;
            ics.Percent = this.Percent;
            ics.Reverse = this.Reverse;

            return ics;
        }
Exemplo n.º 4
0
        internal SLIconSet Clone()
        {
            SLIconSet ics = new SLIconSet();

            ics.Cfvos = new List <SLConditionalFormatValueObject>();
            for (int i = 0; i < this.Cfvos.Count; ++i)
            {
                ics.Cfvos.Add(this.Cfvos[i].Clone());
            }

            ics.IconSetType = this.IconSetType;
            ics.ShowValue   = this.ShowValue;
            ics.Percent     = this.Percent;
            ics.Reverse     = this.Reverse;

            return(ics);
        }
Exemplo n.º 5
0
        internal SLIconSet2010 ToSLIconSet2010()
        {
            SLIconSet2010 ics2010 = new SLIconSet2010();

            ics2010.IconSetType = SLIconSet.TranslateInternalSetToIconSet2010(this.IconSetType);
            ics2010.ShowValue   = this.ShowValue;
            ics2010.Percent     = this.Percent;
            ics2010.Reverse     = this.Reverse;

            foreach (SLConditionalFormatValueObject cfvo in this.Cfvos)
            {
                ics2010.Cfvos.Add(cfvo.ToSLConditionalFormattingValueObject2010());
            }

            foreach (SLConditionalFormattingIcon2010 cfi in this.CustomIcons)
            {
                ics2010.CustomIcons.Add(cfi.Clone());
            }

            return(ics2010);
        }