Ejemplo n.º 1
0
        /// <summary>
        /// Gets an attribute representing the 4 border sides.
        /// If a border style/color/width has been specified individually, it will override the grouped definition.
        /// </summary>
        /// <returns>If the attribute is misformed, the <see cref="HtmlBorder.IsValid"/> property is set to false.</returns>
        public HtmlBorder GetAsBorder(String name)
        {
            HtmlBorder border = new HtmlBorder(GetAsSideBorder(name));
            SideBorder sb;

            sb = GetAsSideBorder(name + "-top");
            if (sb.IsValid)
            {
                border.Top = sb;
            }
            sb = GetAsSideBorder(name + "-right");
            if (sb.IsValid)
            {
                border.Right = sb;
            }
            sb = GetAsSideBorder(name + "-bottom");
            if (sb.IsValid)
            {
                border.Bottom = sb;
            }
            sb = GetAsSideBorder(name + "-left");
            if (sb.IsValid)
            {
                border.Left = sb;
            }

            return(border);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets an attribute representing the 4 border sides.
        /// If a border style/color/width has been specified individually, it will override the grouped definition.
        /// </summary>
        /// <returns>If the attribute is misformed, the <see cref="HtmlBorder.IsValid"/> property is set to false.</returns>
        public HtmlBorder GetAsBorder(String name)
        {
            HtmlBorder border = new HtmlBorder(GetAsSideBorder(name));
            SideBorder sb;

            sb = GetAsSideBorder(name + "-top");
            if (sb.IsValid) border.Top = sb;
            sb = GetAsSideBorder(name + "-right");
            if (sb.IsValid) border.Right = sb;
            sb = GetAsSideBorder(name + "-bottom");
            if (sb.IsValid) border.Bottom = sb;
            sb = GetAsSideBorder(name + "-left");
            if (sb.IsValid) border.Left = sb;

            return border;
        }