Beispiel #1
0
 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);
         }
     }
 }
Beispiel #2
0
        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);
        }