Exemple #1
0
        private XLFillValue(XLFillKey key)
        {
            Key = key;
            var backgroundColorKey = Key.BackgroundColor;
            var patternColorKey    = Key.PatternColor;

            BackgroundColor = XLColor.FromKey(ref backgroundColorKey);
            PatternColor    = XLColor.FromKey(ref patternColorKey);
        }
Exemple #2
0
        private void Modify(Func <XLFillKey, XLFillKey> modification)
        {
            Key = modification(Key);

            _style.Modify(styleKey =>
            {
                var fill      = styleKey.Fill;
                styleKey.Fill = modification(fill);
                return(styleKey);
            });
        }
Exemple #3
0
 public void Deconstruct(
     out XLAlignmentKey alignment,
     out XLBorderKey border,
     out XLFillKey fill,
     out XLFontKey font,
     out Boolean includeQuotePrefix,
     out XLNumberFormatKey numberFormat,
     out XLProtectionKey protection)
 {
     alignment          = Alignment;
     border             = Border;
     fill               = Fill;
     font               = Font;
     includeQuotePrefix = IncludeQuotePrefix;
     numberFormat       = NumberFormat;
     protection         = Protection;
 }
Exemple #4
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);
        }
Exemple #5
0
 public static XLFillValue FromKey(ref XLFillKey key)
 {
     return(Repository.GetOrCreate(ref key));
 }
Exemple #6
0
 public XLFill(XLStyle style, XLFillKey key) : this(style, XLFillValue.FromKey(key))
 {
 }
Exemple #7
0
 private XLFillValue(XLFillKey key)
 {
     Key             = key;
     BackgroundColor = XLColor.FromKey(Key.BackgroundColor);
     PatternColor    = XLColor.FromKey(Key.PatternColor);
 }