/// <summary> /// Creates the Geometry for the Strikethrough decoration, used with the GeometryMakerDelegate. /// </summary> /// <param name="text">The FormattedText used for the decoration</param> /// <param name="p">The pair defining the begining character and the length of the character range</param> /// <returns></returns> private Geometry StrikethroughGeometryMaker(FormattedText text, Pair p) { Geometry geom = text.BuildHighlightGeometry(new Point(0, 0), p.Start, p.Length); if (geom != null) { StackedRectangleGeometryHelper srgh = new StackedRectangleGeometryHelper(geom); return(srgh.CenterLineRectangleGeometry()); } else { return(null); } }
/// <summary> /// Creates the Geometry for the Underline decoration, used with the GeometryMakerDelegate. /// </summary> /// <param name="text">The FormattedText used for the decoration</param> /// <param name="p">The pair defining the begining character and the length of the character range</param> /// <returns></returns> private Geometry UnderlineGeometryMaker(FormattedText text, Pair p) { Geometry geom = text.BuildHighlightGeometry(new Point(0, 0), p.Start, p.Length); if (geom != null) { StackedRectangleGeometryHelper srgh = new StackedRectangleGeometryHelper(geom); return(srgh.BottomEdgeRectangleGeometry()); } else { return(null); } }