internal void FromColorScale(ColorScale cs) { this.SetAllNull(); SLConditionalFormatValueObject cfvo; SLColor clr; using (OpenXmlReader oxr = OpenXmlReader.Create(cs)) { while (oxr.Read()) { if (oxr.ElementType == typeof(ConditionalFormatValueObject)) { cfvo = new SLConditionalFormatValueObject(); cfvo.FromConditionalFormatValueObject((ConditionalFormatValueObject)oxr.LoadCurrentElement()); this.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()); this.Colors.Add(clr); } } } }