public static BorderEdge ToBorderEdge(this BorderEdgeStyle style) { var res = new BorderEdge { Style = GetBorderStyle(style) }; if (style.Color != null) { res.Color = style.Color.ToColor(); } return(res); }
private static Codaxy.Xlio.BorderStyle GetBorderStyle(BorderEdgeStyle style) { if (style.LineStyle == LineStyle.None) { return(Codaxy.Xlio.BorderStyle.None); } if (style.LineWidth > 2) { return(Codaxy.Xlio.BorderStyle.Thick); } if (style.LineWidth > 1) { switch (style.LineStyle) { case LineStyle.DashDot: return(Codaxy.Xlio.BorderStyle.MediumDashDot); case LineStyle.Dashed: return(Codaxy.Xlio.BorderStyle.MediumDashed); case LineStyle.Dotted: return(Codaxy.Xlio.BorderStyle.MediumDashDotDot); default: return(Codaxy.Xlio.BorderStyle.Medium); } } switch (style.LineStyle) { case LineStyle.DashDot: return(Codaxy.Xlio.BorderStyle.DashDot); case LineStyle.Dashed: return(Codaxy.Xlio.BorderStyle.Dashed); case LineStyle.Dotted: return(Codaxy.Xlio.BorderStyle.Dotted); default: return(Codaxy.Xlio.BorderStyle.Hair); } }