/// <summary> /// Marks the given element with the given color. /// </summary> public void MarkElement( HtmlElement e, Color color ) { e.Require( x => e != null ); if ( IsMarked( e ) ) { // unmark first - maybe it was marked with another color before UnmarkElement( e ); } e.MarkElement( color ); MarkedElements.Add( e ); }
/// <summary> /// Removes the markup from the given element if any known. /// </summary> public void UnmarkElement( HtmlElement e ) { e.Require( x => e != null ); if ( !IsMarked( e ) ) { return; } e.UnmarkElement(); MarkedElements.Remove( e ); }
/// <summary> /// Indicates whether the given element is marked. /// </summary> public bool IsMarked( HtmlElement e ) { e.Require( x => e != null ); return MarkedElements.Contains( e ); }
/// <summary> /// Marks the complete row specified by the given table row or cell /// with the given color. /// </summary> public void MarkTableRow( HtmlElement start, Color color ) { start.Require( x => start != null ); HtmlTable.GetRow( myDocument.Create( start ) ) .OfType<HtmlElementAdapter>() .Foreach( e => MarkElement( e.Element, color ) ); }