Exemplo n.º 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);
        }
Exemplo n.º 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);
            });
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public static XLFillValue FromKey(ref XLFillKey key)
 {
     return(Repository.GetOrCreate(ref key));
 }
Exemplo n.º 6
0
 public XLFill(XLStyle style, XLFillKey key) : this(style, XLFillValue.FromKey(key))
 {
 }
Exemplo n.º 7
0
 private XLFillValue(XLFillKey key)
 {
     Key             = key;
     BackgroundColor = XLColor.FromKey(Key.BackgroundColor);
     PatternColor    = XLColor.FromKey(Key.PatternColor);
 }