本文整理汇总了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 ) );
}