public XMLFillModel DeepClone() { CT_Fill cT_Fill = new CT_Fill(); if (_fill.PatternFill != null) { CT_PatternFill patternFill = _fill.PatternFill; CT_PatternFill cT_PatternFill2 = cT_Fill.PatternFill = new CT_PatternFill(); if (patternFill.BgColor != null) { cT_PatternFill2.BgColor = _palette.GetColorFromCT(patternFill.BgColor).Clone().Data; } if (patternFill.FgColor != null) { cT_PatternFill2.FgColor = _palette.GetColorFromCT(patternFill.FgColor).Clone().Data; } cT_PatternFill2.PatternType_Attr = patternFill.PatternType_Attr; } cT_Fill.Choice_0 = _fill.Choice_0; XMLFillModel xMLFillModel = new XMLFillModel(cT_Fill, _palette); if (_background != null) { xMLFillModel._background = _background.Clone(); } if (_foreground != null) { xMLFillModel._foreground = _foreground.Clone(); } return(xMLFillModel); }
public XMLBorderPartModel DeepClone() { XMLBorderPartModel xMLBorderPartModel = new XMLBorderPartModel(new CT_BorderPr(), _palette); if (Part.Color != null) { xMLBorderPartModel.Part.Color = _palette.GetColorFromCT(Part.Color).Clone().Data; } if (Part.Style_Attr != null) { xMLBorderPartModel.Part.Style_Attr = Part.Style_Attr; } xMLBorderPartModel._hasBeenModified = _hasBeenModified; return(xMLBorderPartModel); }
public override int GetHashCode() { int num = 0; if (_font.B != null && (bool)_font.B.Val_Attr) { num |= 0x10; } if (_font.I != null && (bool)_font.I.Val_Attr) { num |= 0x20; } if (_font.Strike != null && (bool)_font.Strike.Val_Attr) { num |= 0x40; } if (_font.Family != null) { num ^= _font.Family.Val_Attr.GetHashCode(); } num ^= ((_font.Name != null) ? _font.Name.Val_Attr.GetHashCode() : "Calibri".GetHashCode()); num ^= ((_font.Sz != null) ? _font.Sz.Val_Attr.GetHashCode() : 11.0.GetHashCode()); num ^= ((_font.U != null) ? _font.U.Val_Attr.GetHashCode() : XMLConstants.Font.Default.Underline.GetHashCode()); num ^= ((_font.VertAlign != null) ? _font.VertAlign.GetHashCode() : XMLConstants.Font.Default.VerticalAlignment.GetHashCode()); CT_Color cT_Color = new CT_Color(); cT_Color.Theme_Attr = 1u; return(num ^ ((_font.Color != null) ? _palette.GetColorFromCT(_font.Color).GetHashCode() : _palette.GetColorFromCT(cT_Color).GetHashCode())); }
public XMLFillModel(CT_Fill fill, XMLPaletteModel palette) { _fill = fill; _palette = palette; if (_fill.PatternFill != null) { if (_fill.PatternFill.FgColor != null) { _foreground = _palette.GetColorFromCT(_fill.PatternFill.FgColor); } if (_fill.PatternFill.BgColor != null) { _background = _palette.GetColorFromCT(_fill.PatternFill.BgColor); } } }