public bool Equals(IXLFill other)
 {
     return
         _patternType == other.PatternType
         && _patternColor.Equals(other.PatternColor)
         && _patternBackgroundColor.Equals(other.PatternBackgroundColor)
         ;
 }
Beispiel #2
0
 public bool Equals(IXLFill other)
 {
     return
         (_patternType == other.PatternType &&
          _backgroundColor.Equals(other.BackgroundColor) &&
          _patternColor.Equals(other.PatternColor)
         );
 }
Beispiel #3
0
        public bool Equals(IXLFill other)
        {
            var otherF = other as XLFill;

            if (otherF == null)
            {
                return(false);
            }

            return(Key == otherF.Key);
        }
Beispiel #4
0
        public XLFill(IXLStylized container, IXLFill defaultFill = null, Boolean useDefaultModify = true)
        {
            _container = container;
            if (defaultFill == null)
            {
                return;
            }
            _patternType     = defaultFill.PatternType;
            _backgroundColor = defaultFill.BackgroundColor;
            _patternColor    = defaultFill.PatternColor;

            if (useDefaultModify)
            {
                var d = defaultFill as XLFill;
            }
        }
Beispiel #5
0
        public XLFill(IXLStylized container, IXLFill defaultFill = null, Boolean useDefaultModify = true)
        {
            _container = container;
            if (defaultFill == null)
            {
                return;
            }
            _patternType            = defaultFill.PatternType;
            _patternColor           = new XLColor(defaultFill.PatternColor);
            _patternBackgroundColor = new XLColor(defaultFill.PatternBackgroundColor);

            if (useDefaultModify)
            {
                var d = defaultFill as XLFill;
                PatternBackgroundColorModified = d.PatternBackgroundColorModified;
                PatternColorModified           = d.PatternColorModified;
                PatternTypeModified            = d.PatternTypeModified;
            }
        }
Beispiel #6
0
        internal static XLFillKey GenerateKey(IXLFill defaultFill)
        {
            XLFillKey key;

            if (defaultFill == null)
            {
                key = XLFillValue.Default.Key;
            }
            else if (defaultFill is XLFill)
            {
                key = (defaultFill as XLFill).Key;
            }
            else
            {
                key = new XLFillKey
                {
                    PatternType     = defaultFill.PatternType,
                    BackgroundColor = defaultFill.BackgroundColor.Key,
                    PatternColor    = defaultFill.PatternColor.Key
                };
            }
            return(key);
        }
        private bool FillsAreEqual(Fill f, IXLFill xlFill)
        {
            var nF = new XLFill();
            if (f.PatternFill != null)
            {
                if (f.PatternFill.PatternType != null)
                    nF.PatternType = f.PatternFill.PatternType.Value.ToClosedXml();

                var fColor = GetColor(f.PatternFill.ForegroundColor);
                if (fColor.HasValue)
                    nF.PatternColor = fColor;

                var bColor = GetColor(f.PatternFill.BackgroundColor);
                if (bColor.HasValue)
                    nF.PatternBackgroundColor = bColor;
            }
            return nF.Equals(xlFill);
        }
Beispiel #8
0
 public XLFill(XLStyle style = null, IXLFill d = null) : this(style, GenerateKey(d))
 {
 }
        public XLFill(IXLStylized container, IXLFill defaultFill = null, Boolean useDefaultModify = true)
        {
            _container = container;
            if (defaultFill == null) return;
            _patternType = defaultFill.PatternType;
            _patternColor = new XLColor(defaultFill.PatternColor);
            _patternBackgroundColor = new XLColor(defaultFill.PatternBackgroundColor);

            if (useDefaultModify)
            {
                var d = defaultFill as XLFill;
                PatternBackgroundColorModified = d.PatternBackgroundColorModified;
                PatternColorModified = d.PatternColorModified;
                PatternTypeModified = d.PatternTypeModified;
            }
        }
Beispiel #10
0
 public void AplicarEstilo(IXLFill style)
 {
     style.BackgroundColor = ColorFondo;
     style.PatternColor    = ColorPatron;
     style.PatternType     = TipoPatron;
 }