예제 #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);
        }
        public ConditionalFormattingRule Convert(IXLConditionalFormat cf, Int32 priority, XLWorkbook.SaveContext context)
        {
            var conditionalFormattingRule = new ConditionalFormattingRule { Type = cf.ConditionalFormatType.ToOpenXml(), Priority = priority };

            var iconSet = new IconSet {ShowValue = !cf.ShowIconOnly, Reverse = cf.ReverseIconOrder, IconSetValue = cf.IconSetStyle.ToOpenXml()};
            Int32 count = cf.Values.Count;
            for(Int32 i=1;i<= count; i++ )
            {
                var conditionalFormatValueObject = new ConditionalFormatValueObject { Type = cf.ContentTypes[i].ToOpenXml(), Val = cf.Values[i].Value, GreaterThanOrEqual = cf.IconSetOperators[i] == XLCFIconSetOperator.EqualOrGreaterThan};    
                iconSet.Append(conditionalFormatValueObject);
                
            }
            conditionalFormattingRule.Append(iconSet);
            return conditionalFormattingRule;
        }
예제 #3
0
        internal IconSet ToIconSet()
        {
            IconSet ics = new IconSet();
            if (this.IconSetValue != IconSetValues.ThreeTrafficLights1) ics.IconSetValue = this.IconSetValue;
            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;
        }
예제 #4
0
        public ConditionalFormattingRule Convert(IXLConditionalFormat cf, Int32 priority, XLWorkbook.SaveContext context)
        {
            var conditionalFormattingRule = XLCFBaseConverter.Convert(cf, priority);

            var iconSet = new IconSet {
                ShowValue = !cf.ShowIconOnly, Reverse = cf.ReverseIconOrder, IconSetValue = cf.IconSetStyle.ToOpenXml()
            };
            Int32 count = cf.Values.Count;

            for (Int32 i = 1; i <= count; i++)
            {
                var conditionalFormatValueObject = new ConditionalFormatValueObject {
                    Type = cf.ContentTypes[i].ToOpenXml(), Val = cf.Values[i].Value, GreaterThanOrEqual = cf.IconSetOperators[i] == XLCFIconSetOperator.EqualOrGreaterThan
                };
                iconSet.Append(conditionalFormatValueObject);
            }
            conditionalFormattingRule.Append(iconSet);
            return(conditionalFormattingRule);
        }