internal BorderItemXmlWrapper Copy()
        {
            BorderItemXmlWrapper borderItem = new BorderItemXmlWrapper();
            borderItem.Style = this._BorderStyle;
            borderItem.Color = this._Color.Copy();

            return borderItem;
        }
Beispiel #2
0
        internal BorderItemXmlWrapper Copy()
        {
            BorderItemXmlWrapper borderItem = new BorderItemXmlWrapper();

            borderItem.Style = this._BorderStyle;
            borderItem.Color = this._Color.Copy();

            return(borderItem);
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        /// <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;
                }
            }
        }