/// <summary>Gets the array that defines the borders.</summary> /// <param name="styles">the styles mapping</param> /// <param name="em">the em value</param> /// <param name="rem">the root em value</param> /// <returns>the borders array</returns> public static BorderRadius[] GetBorderRadiiArray(IDictionary <String, String> styles, float em, float rem) { BorderRadius[] borderRadii = new BorderRadius[4]; BorderRadius borderRadius = null; UnitValue borderRadiusUV = CssDimensionParsingUtils.ParseLengthValueToPt(styles.Get(CssConstants.BORDER_RADIUS ), em, rem); if (null != borderRadiusUV) { borderRadius = new BorderRadius(borderRadiusUV); } UnitValue[] borderTopLeftRadiusUV = CssDimensionParsingUtils.ParseSpecificCornerBorderRadius(styles.Get(CssConstants .BORDER_TOP_LEFT_RADIUS), em, rem); borderRadii[0] = null == borderTopLeftRadiusUV ? borderRadius : new BorderRadius(borderTopLeftRadiusUV[0], borderTopLeftRadiusUV[1]); UnitValue[] borderTopRightRadiusUV = CssDimensionParsingUtils.ParseSpecificCornerBorderRadius(styles.Get(CssConstants .BORDER_TOP_RIGHT_RADIUS), em, rem); borderRadii[1] = null == borderTopRightRadiusUV ? borderRadius : new BorderRadius(borderTopRightRadiusUV[0 ], borderTopRightRadiusUV[1]); UnitValue[] borderBottomRightRadiusUV = CssDimensionParsingUtils.ParseSpecificCornerBorderRadius(styles.Get (CssConstants.BORDER_BOTTOM_RIGHT_RADIUS), em, rem); borderRadii[2] = null == borderBottomRightRadiusUV ? borderRadius : new BorderRadius(borderBottomRightRadiusUV [0], borderBottomRightRadiusUV[1]); UnitValue[] borderBottomLeftRadiusUV = CssDimensionParsingUtils.ParseSpecificCornerBorderRadius(styles.Get (CssConstants.BORDER_BOTTOM_LEFT_RADIUS), em, rem); borderRadii[3] = null == borderBottomLeftRadiusUV ? borderRadius : new BorderRadius(borderBottomLeftRadiusUV [0], borderBottomLeftRadiusUV[1]); return(borderRadii); }