Esempio n. 1
0
        /// <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 );
        }
Esempio n. 2
0
        /// <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 );
        }
Esempio n. 3
0
        /// <summary>
        /// Indicates whether the given element is marked.
        /// </summary>
        public bool IsMarked( HtmlElement e )
        {
            e.Require( x => e != null );

            return MarkedElements.Contains( e );
        }
Esempio n. 4
0
        /// <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 ) );
        }