本文整理匯總了C#中System.Windows.Forms.HtmlElement.Require方法的典型用法代碼示例。如果您正苦於以下問題:C# HtmlElement.Require方法的具體用法?C# HtmlElement.Require怎麽用?C# HtmlElement.Require使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.Require方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MarkElement
/// <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 );
}
示例2: UnmarkElement
/// <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 );
}
示例3: IsMarked
/// <summary>
/// Indicates whether the given element is marked.
/// </summary>
public bool IsMarked( HtmlElement e )
{
e.Require( x => e != null );
return MarkedElements.Contains( e );
}
示例4: MarkTableRow
/// <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 ) );
}