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); } } }
public override bool Equals(object o) { if (!(o is XMLColorModel)) { return(false); } XMLColorModel xMLColorModel = (XMLColorModel)o; if (_color.Rgb_Attr != null && xMLColorModel._color.Rgb_Attr != null) { return(_color.Rgb_Attr == xMLColorModel._color.Rgb_Attr); } if (_color.Rgb_Attr == null && xMLColorModel._color.Rgb_Attr == null) { if (_color.Indexed_Attr_Is_Specified ^ xMLColorModel._color.Indexed_Attr_Is_Specified) { return(false); } if (_color.Indexed_Attr_Is_Specified && _color.Indexed_Attr != xMLColorModel._color.Indexed_Attr) { return(false); } if (_color.Theme_Attr_Is_Specified ^ xMLColorModel._color.Theme_Attr_Is_Specified) { return(false); } if (_color.Theme_Attr_Is_Specified && _color.Theme_Attr != xMLColorModel._color.Theme_Attr) { return(false); } if (_color.Tint_Attr == xMLColorModel._color.Tint_Attr) { return(_color.Auto_Attr == xMLColorModel._color.Auto_Attr); } return(false); } return(false); }