internal ExcelFontXml(XmlNamespaceManager nsm, XmlNode topNode) : base(nsm, topNode) { _name = GetXmlNodeString(namePath); _size = (float)GetXmlNodeDecimal(sizePath); _family = GetXmlNodeIntNull(familyPath) ?? int.MinValue; _scheme = GetXmlNodeString(schemePath); _color = new ExcelColorXml(nsm, topNode.SelectSingleNode(_colorPath, nsm)); _bold = GetBoolValue(topNode, boldPath); _italic = GetBoolValue(topNode, italicPath); _verticalAlign = GetXmlNodeString(verticalAlignPath); if (topNode.SelectSingleNode(underLinedPath, NameSpaceManager) != null) { string ut = GetXmlNodeString(underLinedPath + "/@val"); if (ut == "") { _underlineType = ExcelUnderLineType.Single; } else { _underlineType = (ExcelUnderLineType)Enum.Parse(typeof(ExcelUnderLineType), ut, true); } } else { _underlineType = ExcelUnderLineType.None; } }
internal ExcelFontXml(XmlNamespaceManager nameSpaceManager) : base(nameSpaceManager) { _name = ""; _size = 0; _family = int.MinValue; _scheme = ""; _color = _color = new ExcelColorXml(NameSpaceManager); _bold = false; _italic = false; _underlineType = ExcelUnderLineType.None; _verticalAlign = ""; }
internal ExcelFontXml(XmlNamespaceManager nsm, XmlNode topNode) : base(nsm, topNode) { _name = GetXmlNodeString(namePath); _size = (float)GetXmlNodeDecimal(sizePath); _family = GetXmlNodeInt(familyPath); _scheme = GetXmlNodeString(schemePath); _color = new ExcelColorXml(nsm, topNode.SelectSingleNode(_colorPath, nsm)); _bold = (topNode.SelectSingleNode(boldPath, NameSpaceManager) != null); _italic = (topNode.SelectSingleNode(italicPath, NameSpaceManager) != null); _strike = (topNode.SelectSingleNode(strikePath, NameSpaceManager) != null); _verticalAlign = GetXmlNodeString(verticalAlignPath); if (topNode.SelectSingleNode(underLinedPath, NameSpaceManager) != null) { string ut = GetXmlNodeString(underLinedPath + "/@val"); if (ut == "") { _underlineType = ExcelUnderLineType.Single; } else { _underlineType = (ExcelUnderLineType)Enum.Parse(typeof(ExcelUnderLineType), ut, true); } } else { _underlineType = ExcelUnderLineType.None; } }
internal ExcelFontXml(XmlNamespaceManager nameSpaceManager) : base(nameSpaceManager) { _name = ""; _size = 0; _family = int.MinValue; _scheme = ""; _color = _color = new ExcelColorXml(NameSpaceManager); _bold = false; _italic = false; _strike = false; _underlineType = ExcelUnderLineType.None ; _verticalAlign = ""; }
/// <summary> /// Apply conditional formatting style to rule style property /// </summary> /// <param name="style"></param> /// <param name="ssStyle"></param> internal static void ApplyConditionalFormattingStyle(ExcelDxfStyleConditionalFormatting style, RCConditionalFormatStyleRecord ssStyle) { ExcelUnderLineType underline = (ExcelUnderLineType)ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssUnderline; ExcelBorderStyle bTop = (ExcelBorderStyle)ssStyle.ssSTConditionalFormatStyle.ssBorderTop.ssSTBorderStyle.ssStyle; ExcelBorderStyle bBottom = (ExcelBorderStyle)ssStyle.ssSTConditionalFormatStyle.ssBorderBottom.ssSTBorderStyle.ssStyle; ExcelBorderStyle bLeft = (ExcelBorderStyle)ssStyle.ssSTConditionalFormatStyle.ssBorderLeft.ssSTBorderStyle.ssStyle; ExcelBorderStyle bRight = (ExcelBorderStyle)ssStyle.ssSTConditionalFormatStyle.ssBorderRight.ssSTBorderStyle.ssStyle; ExcelFillStyle patternType = (ExcelFillStyle)ssStyle.ssSTConditionalFormatStyle.ssFill.ssSTFillStyle.ssPatternType; style.Border.Bottom.Style = bBottom; if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssBorderBottom.ssSTBorderStyle.ssColor)) { style.Border.Bottom.Color.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssBorderBottom.ssSTBorderStyle.ssColor); } style.Border.Left.Style = bLeft; if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssBorderLeft.ssSTBorderStyle.ssColor)) { style.Border.Left.Color.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssBorderLeft.ssSTBorderStyle.ssColor); } style.Border.Right.Style = bRight; if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssBorderRight.ssSTBorderStyle.ssColor)) { style.Border.Right.Color.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssBorderRight.ssSTBorderStyle.ssColor); } style.Border.Top.Style = bTop; if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssBorderTop.ssSTBorderStyle.ssColor)) { style.Border.Top.Color.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssBorderTop.ssSTBorderStyle.ssColor); } if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssFill.ssSTFillStyle.ssBackgroundColor)) { style.Fill.BackgroundColor.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssFill.ssSTFillStyle.ssBackgroundColor); } if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssFill.ssSTFillStyle.ssPatternColor)) { style.Fill.PatternColor.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssFill.ssSTFillStyle.ssPatternColor); } style.Fill.PatternType = patternType; style.Font.Bold = ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssBold; style.Font.Italic = ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssItalic; if (ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssStrike) { style.Font.Strike = ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssStrike; } else { style.Font.Strike = null; } style.Font.Underline = underline; if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssColor)) { style.Font.Color.Color = ConvertFromColorCode(ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssColor); } if (!string.IsNullOrEmpty(ssStyle.ssSTConditionalFormatStyle.ssNumberFormat)) { style.NumberFormat.Format = ssStyle.ssSTConditionalFormatStyle.ssNumberFormat; } }