예제 #1
0
        private void LoadBorder(XmlNode node, Border border)
        {
            string sides = GetAttribute(node, "Sides");

            if (string.IsNullOrEmpty(sides))
            {
                sides = GetAttribute(node, "Borders");
            }
            border.Lines = UnitsConverter.ConvertBorderSides(sides, border);
            border.Color = UnitsConverter.ConvertColor(GetAttribute(node, "BorderColor"));
            border.Width = UnitsConverter.SizeFToPixels(GetAttribute(node, "BorderWidthSerializable"));
            border.Style = UnitsConverter.ConvertBorderDashStyle(GetAttribute(node, "BorderDashStyle"));
        }
        private void LoadBorder(string description, Border border)
        {
            string borders = GetPropertyValue("Borders", description);

            if (!String.IsNullOrEmpty(borders))
            {
                if (borders.IndexOf("Left") > -1)
                {
                    border.Lines |= BorderLines.Left;
                }
                if (borders.IndexOf("Top") > -1)
                {
                    border.Lines |= BorderLines.Top;
                }
                if (borders.IndexOf("Right") > -1)
                {
                    border.Lines |= BorderLines.Right;
                }
                if (borders.IndexOf("Bottom") > -1)
                {
                    border.Lines |= BorderLines.Bottom;
                }
            }
            string color = GetPropertyValue("BorderColor", description);

            if (!String.IsNullOrEmpty(color))
            {
                border.Color = UnitsConverter.ConvertColor(color);
            }
            string style = GetPropertyValue("BorderDashStyle", description);

            if (!String.IsNullOrEmpty(style))
            {
                border.Style = UnitsConverter.ConvertBorderDashStyle(style);
            }
            string width = GetPropertyValue("BorderWidth", description);

            if (!String.IsNullOrEmpty(width))
            {
                border.Width = UnitsConverter.SizeFToPixels(width);
            }
        }