internal void FromDataBar(X14.DataBar db) { SetAllNull(); using (var oxr = OpenXmlReader.Create(db)) { var i = 0; while (oxr.Read()) { if (oxr.ElementType == typeof(X14.ConditionalFormattingValueObject)) { if (i == 0) { Cfvo1.FromConditionalFormattingValueObject( (X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement()); ++i; } else if (i == 1) { Cfvo2.FromConditionalFormattingValueObject( (X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement()); ++i; } } else if (oxr.ElementType == typeof(X14.FillColor)) { FillColor.FromFillColor((X14.FillColor)oxr.LoadCurrentElement()); } else if (oxr.ElementType == typeof(X14.BorderColor)) { BorderColor.FromBorderColor((X14.BorderColor)oxr.LoadCurrentElement()); } else if (oxr.ElementType == typeof(X14.NegativeFillColor)) { NegativeFillColor.FromNegativeFillColor((X14.NegativeFillColor)oxr.LoadCurrentElement()); } else if (oxr.ElementType == typeof(X14.NegativeBorderColor)) { NegativeBorderColor.FromNegativeBorderColor((X14.NegativeBorderColor)oxr.LoadCurrentElement()); } else if (oxr.ElementType == typeof(X14.BarAxisColor)) { AxisColor.FromBarAxisColor((X14.BarAxisColor)oxr.LoadCurrentElement()); } } } if (db.MinLength != null) { MinLength = db.MinLength.Value; } if (db.MaxLength != null) { MaxLength = db.MaxLength.Value; } if (db.ShowValue != null) { ShowValue = db.ShowValue.Value; } if (db.Border != null) { Border = db.Border.Value; } if (db.Gradient != null) { Gradient = db.Gradient.Value; } if (db.Direction != null) { Direction = db.Direction.Value; } if (db.NegativeBarColorSameAsPositive != null) { NegativeBarColorSameAsPositive = db.NegativeBarColorSameAsPositive.Value; } if (db.NegativeBarBorderColorSameAsPositive != null) { NegativeBarBorderColorSameAsPositive = db.NegativeBarBorderColorSameAsPositive.Value; } if (db.AxisPosition != null) { AxisPosition = db.AxisPosition.Value; } }