internal void FromConditionalFormatting(X14.ConditionalFormatting cf) { this.SetAllNull(); if (cf.Pivot != null) { this.Pivot = cf.Pivot.Value; } using (OpenXmlReader oxr = OpenXmlReader.Create(cf)) { while (oxr.Read()) { SLConditionalFormattingRule2010 cfr; if (oxr.ElementType == typeof(X14.ConditionalFormattingRule)) { cfr = new SLConditionalFormattingRule2010(); cfr.FromConditionalFormattingRule((X14.ConditionalFormattingRule)oxr.LoadCurrentElement()); this.Rules.Add(cfr); } else if (oxr.ElementType == typeof(Excel.ReferenceSequence)) { Excel.ReferenceSequence refseq = (Excel.ReferenceSequence)oxr.LoadCurrentElement(); this.ReferenceSequence = SLTool.TranslateRefSeqToCellPointRange(refseq); } } } }