internal BorderItemXmlWrapper Copy() { BorderItemXmlWrapper borderItem = new BorderItemXmlWrapper(); borderItem.Style = this._BorderStyle; borderItem.Color = this._Color.Copy(); return borderItem; }
internal BorderItemXmlWrapper Copy() { BorderItemXmlWrapper borderItem = new BorderItemXmlWrapper(); borderItem.Style = this._BorderStyle; borderItem.Color = this._Color.Copy(); return(borderItem); }
private void SetBorderItem(BorderItemXmlWrapper excelBorderItem, ExcelStyleProperty styleProperty, object value) { if (styleProperty == ExcelStyleProperty.Style) { excelBorderItem.Style = (ExcelBorderStyle)value; } else if (styleProperty == ExcelStyleProperty.Color) { ExceptionHelper.TrueThrow(excelBorderItem.Style == ExcelBorderStyle.None, "不能设置边框样式为None"); excelBorderItem.Color.Rgb = value.ToString(); } }
private static void WriteBorderItem(BorderItemXmlWrapper borderItem, XElement borderXml) { if (borderItem.Style != ExcelBorderStyle.None) borderXml.Add(new XAttribute("style", borderItem.SetBorderString(borderItem.Style))); if (borderItem._Color != null) borderXml.Add(WriteColor(borderItem._Color)); }
/// <summary> /// FileName:styles.xml /// <para>NodePath:styleSheet/borders/border/[border items]</para> /// </summary> /// <param name="root"></param> /// <returns></returns> public void ReadStyles_borderitem(BorderItemXmlWrapper target, XElement item) { if (item.Attribute("style") != null) { target.Style = target.GetBorderStyle(item.Attribute("style").Value); } foreach (XElement itemSubNode in item.Nodes()) { switch (itemSubNode.Name.LocalName) { case "color": ReadStyles_Color(itemSubNode, target.Color); break; } } }