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 void FromIconSet(IconSet ics) { SetAllNull(); if (ics.IconSetValue != null) { IconSetType = TranslateIconSetToInternalSet(ics.IconSetValue.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)) { SLConditionalFormatValueObject cfvo; while (oxr.Read()) { if (oxr.ElementType == typeof(ConditionalFormatValueObject)) { cfvo = new SLConditionalFormatValueObject(); cfvo.FromConditionalFormatValueObject((ConditionalFormatValueObject)oxr.LoadCurrentElement()); Cfvos.Add(cfvo); } } } }
internal void FromColorScale(ColorScale cs) { SetAllNull(); SLConditionalFormatValueObject cfvo; SLColor clr; using (var oxr = OpenXmlReader.Create(cs)) { while (oxr.Read()) { if (oxr.ElementType == typeof(ConditionalFormatValueObject)) { cfvo = new SLConditionalFormatValueObject(); cfvo.FromConditionalFormatValueObject((ConditionalFormatValueObject)oxr.LoadCurrentElement()); Cfvos.Add(cfvo); } else if (oxr.ElementType == typeof(Color)) { clr = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>()); clr.FromSpreadsheetColor((Color)oxr.LoadCurrentElement()); Colors.Add(clr); } } } }
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); } } } }