/// <summary> /// Called when the user presses clear highlight button /// </summary> /// <param name="arg"></param> void OnClearHighlightButtonClick(NEventArgs arg) { NList <NNode> shapes = m_DrawingView.Drawing.GetDescendants(NShape.NShapeSchema); for (int i = 0; i < shapes.Count; i++) { NShape shape = (NShape)shapes[i]; NRangeTextElement rootTextElement = (NRangeTextElement)shape.GetTextBlockContentNoCreate(); if (rootTextElement == null) { continue; } rootTextElement.VisitRanges(delegate(NRangeTextElement range) { NInline inline = range as NInline; if (inline != null) { inline.ClearLocalValue(NInline.HighlightFillProperty); } }); } }
/// <summary> /// Called when the user presses clear highlight button /// </summary> /// <param name="arg"></param> void OnClearHighlightButtonClick(NEventArgs arg) { ((Nevron.Nov.Text.NBlock) m_RichText.EditingRoot).VisitRanges(delegate(NRangeTextElement range) { NInline inline = range as NInline; if (inline != null) { inline.ClearLocalValue(NInline.HighlightFillProperty); } }); }
void OnSelectCurrentParagraphButtonClick(NEventArgs arg) { NInline inline = m_RichText.Selection.CaretInline; if (inline == null) { return; } NParagraph currentParagraph = inline.ParentBlock as NParagraph; if (currentParagraph != null) { m_RichText.Selection.SelectRange(currentParagraph.Range); } }