1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Xml;
|
---|
6 |
|
---|
7 | namespace OfficeOpenXml.Style.Dxf
|
---|
8 | {
|
---|
9 | public class ExcelDxfBorderBase : DxfStyleBase<ExcelDxfBorderBase>
|
---|
10 | {
|
---|
11 | internal ExcelDxfBorderBase(ExcelStyles styles)
|
---|
12 | : base(styles)
|
---|
13 | {
|
---|
14 | Left=new ExcelDxfBorderItem(_styles);
|
---|
15 | Right = new ExcelDxfBorderItem(_styles);
|
---|
16 | Top = new ExcelDxfBorderItem(_styles);
|
---|
17 | Bottom = new ExcelDxfBorderItem(_styles);
|
---|
18 | }
|
---|
19 | /// <summary>
|
---|
20 | /// Left border style
|
---|
21 | /// </summary>
|
---|
22 | public ExcelDxfBorderItem Left
|
---|
23 | {
|
---|
24 | get;
|
---|
25 | internal set;
|
---|
26 | }
|
---|
27 | /// <summary>
|
---|
28 | /// Right border style
|
---|
29 | /// </summary>
|
---|
30 | public ExcelDxfBorderItem Right
|
---|
31 | {
|
---|
32 | get;
|
---|
33 | internal set;
|
---|
34 | }
|
---|
35 | /// <summary>
|
---|
36 | /// Top border style
|
---|
37 | /// </summary>
|
---|
38 | public ExcelDxfBorderItem Top
|
---|
39 | {
|
---|
40 | get;
|
---|
41 | internal set;
|
---|
42 | }
|
---|
43 | /// <summary>
|
---|
44 | /// Bottom border style
|
---|
45 | /// </summary>
|
---|
46 | public ExcelDxfBorderItem Bottom
|
---|
47 | {
|
---|
48 | get;
|
---|
49 | internal set;
|
---|
50 | }
|
---|
51 | ///// <summary>
|
---|
52 | ///// Diagonal border style
|
---|
53 | ///// </summary>
|
---|
54 | //public ExcelDxfBorderItem Diagonal
|
---|
55 | //{
|
---|
56 | // get;
|
---|
57 | // private set;
|
---|
58 | //}
|
---|
59 | ///// <summary>
|
---|
60 | ///// A diagonal from the bottom left to top right of the cell
|
---|
61 | ///// </summary>
|
---|
62 | //public bool DiagonalUp
|
---|
63 | //{
|
---|
64 | // get;
|
---|
65 | // set;
|
---|
66 | //}
|
---|
67 | ///// <summary>
|
---|
68 | ///// A diagonal from the top left to bottom right of the cell
|
---|
69 | ///// </summary>
|
---|
70 | //public bool DiagonalDown
|
---|
71 | //{
|
---|
72 | // get;
|
---|
73 | // set;
|
---|
74 | //}
|
---|
75 |
|
---|
76 | protected internal override string Id
|
---|
77 | {
|
---|
78 | get
|
---|
79 | {
|
---|
80 | return Top.Id + Bottom.Id + Left.Id + Right.Id/* + Diagonal.Id + GetAsString(DiagonalUp) + GetAsString(DiagonalDown)*/;
|
---|
81 | }
|
---|
82 | }
|
---|
83 |
|
---|
84 | protected internal override void CreateNodes(XmlHelper helper, string path)
|
---|
85 | {
|
---|
86 | Left.CreateNodes(helper, path + "/d:left");
|
---|
87 | Right.CreateNodes(helper, path + "/d:right");
|
---|
88 | Top.CreateNodes(helper, path + "/d:top");
|
---|
89 | Bottom.CreateNodes(helper, path + "/d:bottom");
|
---|
90 | }
|
---|
91 | protected internal override bool HasValue
|
---|
92 | {
|
---|
93 | get
|
---|
94 | {
|
---|
95 | return Left.HasValue ||
|
---|
96 | Right.HasValue ||
|
---|
97 | Top.HasValue ||
|
---|
98 | Bottom.HasValue;
|
---|
99 | }
|
---|
100 | }
|
---|
101 | protected internal override ExcelDxfBorderBase Clone()
|
---|
102 | {
|
---|
103 | return new ExcelDxfBorderBase(_styles) { Bottom = Bottom.Clone(), Top=Top.Clone(), Left=Left.Clone(), Right=Right.Clone() };
|
---|
104 | }
|
---|
105 | }
|
---|
106 | }
|
---|