Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/4.0.3/EPPlus-4.0.3/Style/Dxf/ExcelDxfFill.cs @ 12707

Last change on this file since 12707 was 12074, checked in by sraggl, 10 years ago

#2341: Added EPPlus-4.0.3 to ExtLibs

File size: 2.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Drawing;
6using System.Xml;
7
8namespace OfficeOpenXml.Style.Dxf
9{
10    public class ExcelDxfFill : DxfStyleBase<ExcelDxfFill>
11    {
12        public ExcelDxfFill(ExcelStyles styles)
13            : base(styles)
14        {
15            PatternColor = new ExcelDxfColor(styles);
16            BackgroundColor = new ExcelDxfColor(styles);
17        }
18        public ExcelFillStyle? PatternType { get; set; }
19        /// <summary>
20        /// The color of the pattern
21        /// </summary>
22        public ExcelDxfColor PatternColor { get; internal set; }
23        /// <summary>
24        /// The background color
25        /// </summary>
26        public ExcelDxfColor BackgroundColor { get; internal set; }
27
28        protected internal override string Id
29        {
30            get
31            {
32                return GetAsString(PatternType) + "|" + (PatternColor == null ? "" : PatternColor.Id) + "|" + (BackgroundColor == null ? "" : BackgroundColor.Id);
33            }
34        }
35        protected internal override void CreateNodes(XmlHelper helper, string path)
36        {
37            helper.CreateNode(path);
38            SetValueEnum(helper, path + "/d:patternFill/@patternType", PatternType);
39            SetValueColor(helper, path + "/d:patternFill/d:fgColor", PatternColor);
40            SetValueColor(helper, path + "/d:patternFill/d:bgColor", BackgroundColor);
41        }
42
43        protected internal override bool HasValue
44        {
45            get
46            {
47                return PatternType != null ||
48                    PatternColor.HasValue ||
49                    BackgroundColor.HasValue;
50            }
51        }
52        protected internal override ExcelDxfFill Clone()
53        {
54            return new ExcelDxfFill(_styles) {PatternType=PatternType, PatternColor=PatternColor.Clone(), BackgroundColor=BackgroundColor.Clone()};
55        }
56    }
57}
Note: See TracBrowser for help on using the repository browser.