Ejemplo n.º 1
0
 public XMLFillModel(CT_Fill fill, XMLPaletteModel palette)
 {
     this._fill    = fill;
     this._palette = palette;
     if (this._fill.PatternFill != null)
     {
         if (this._fill.PatternFill.FgColor != null)
         {
             this._foreground = this._palette.GetColorFromCT(this._fill.PatternFill.FgColor);
         }
         if (this._fill.PatternFill.BgColor != null)
         {
             this._background = this._palette.GetColorFromCT(this._fill.PatternFill.BgColor);
         }
     }
 }
        public override bool Equals(object o)
        {
            if (!(o is XMLColorModel))
            {
                return(false);
            }
            XMLColorModel xMLColorModel = (XMLColorModel)o;

            if (this._color.Rgb_Attr != null && xMLColorModel._color.Rgb_Attr != null)
            {
                return(this._color.Rgb_Attr == xMLColorModel._color.Rgb_Attr);
            }
            if (this._color.Rgb_Attr == null && xMLColorModel._color.Rgb_Attr == null)
            {
                if (this._color.Indexed_Attr_Is_Specified ^ xMLColorModel._color.Indexed_Attr_Is_Specified)
                {
                    return(false);
                }
                if (this._color.Indexed_Attr_Is_Specified && this._color.Indexed_Attr != xMLColorModel._color.Indexed_Attr)
                {
                    return(false);
                }
                if (this._color.Theme_Attr_Is_Specified ^ xMLColorModel._color.Theme_Attr_Is_Specified)
                {
                    return(false);
                }
                if (this._color.Theme_Attr_Is_Specified && this._color.Theme_Attr != xMLColorModel._color.Theme_Attr)
                {
                    return(false);
                }
                if (this._color.Tint_Attr == xMLColorModel._color.Tint_Attr)
                {
                    return(this._color.Auto_Attr == xMLColorModel._color.Auto_Attr);
                }
                return(false);
            }
            return(false);
        }