1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Drawing;
|
---|
6 | using System.Xml;
|
---|
7 |
|
---|
8 | namespace OfficeOpenXml.Style.Dxf
|
---|
9 | {
|
---|
10 | public class ExcelDxfFontBase : DxfStyleBase<ExcelDxfFontBase>
|
---|
11 | {
|
---|
12 | public ExcelDxfFontBase(ExcelStyles styles)
|
---|
13 | : base(styles)
|
---|
14 | {
|
---|
15 | Color = new ExcelDxfColor(styles);
|
---|
16 | }
|
---|
17 | /// <summary>
|
---|
18 | /// Font bold
|
---|
19 | /// </summary>
|
---|
20 | public bool? Bold
|
---|
21 | {
|
---|
22 | get;
|
---|
23 | set;
|
---|
24 | }
|
---|
25 | /// <summary>
|
---|
26 | /// Font Italic
|
---|
27 | /// </summary>
|
---|
28 | public bool? Italic
|
---|
29 | {
|
---|
30 | get;
|
---|
31 | set;
|
---|
32 | }
|
---|
33 | /// <summary>
|
---|
34 | /// Font-Strikeout
|
---|
35 | /// </summary>
|
---|
36 | public bool? Strike { get; set; }
|
---|
37 | //public float? Size { get; set; }
|
---|
38 | public ExcelDxfColor Color { get; set; }
|
---|
39 | //public string Name { get; set; }
|
---|
40 | //public int? Family { get; set; }
|
---|
41 | ///// <summary>
|
---|
42 | ///// Font-Vertical Align
|
---|
43 | ///// </summary>
|
---|
44 | //public ExcelVerticalAlignmentFont? VerticalAlign
|
---|
45 | //{
|
---|
46 | // get;
|
---|
47 | // set;
|
---|
48 | //}
|
---|
49 |
|
---|
50 | public ExcelUnderLineType? Underline { get; set; }
|
---|
51 |
|
---|
52 | protected internal override string Id
|
---|
53 | {
|
---|
54 | get
|
---|
55 | {
|
---|
56 | return GetAsString(Bold) + "|" + GetAsString(Italic) + "|" + GetAsString(Strike) + "|" + (Color ==null ? "" : Color.Id) + "|" /*+ GetAsString(VerticalAlign) + "|"*/ + GetAsString(Underline);
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|
60 | protected internal override void CreateNodes(XmlHelper helper, string path)
|
---|
61 | {
|
---|
62 | helper.CreateNode(path);
|
---|
63 | SetValueBool(helper, path + "/d:b/@val", Bold);
|
---|
64 | SetValueBool(helper, path + "/d:i/@val", Italic);
|
---|
65 | SetValueBool(helper, path + "/d:strike", Strike);
|
---|
66 | SetValue(helper, path + "/d:u/@val", Underline);
|
---|
67 | SetValueColor(helper, path + "/d:color", Color);
|
---|
68 | }
|
---|
69 | protected internal override bool HasValue
|
---|
70 | {
|
---|
71 | get
|
---|
72 | {
|
---|
73 | return Bold != null ||
|
---|
74 | Italic != null ||
|
---|
75 | Strike != null ||
|
---|
76 | Underline != null ||
|
---|
77 | Color.HasValue;
|
---|
78 | }
|
---|
79 | }
|
---|
80 | protected internal override ExcelDxfFontBase Clone()
|
---|
81 | {
|
---|
82 | return new ExcelDxfFontBase(_styles) { Bold = Bold, Color = Color.Clone(), Italic = Italic, Strike = Strike, Underline = Underline };
|
---|
83 | }
|
---|
84 | }
|
---|
85 | }
|
---|