示例#1
0
 /// <summary>
 /// A match occurs when one tage is an opening tag and
 /// the other is a closing tag.
 /// Returns true if the given other tag is non-null
 /// and matches this tag; that is, if they have the
 /// same element but opposite types, such as &lt;body&gt;
 /// and &lt;/body&gt;.
 /// </summary>
 /// <param name="other">other is an HtmlTag to compare
 /// this HtmlTag with
 /// </param>
 /// <returns>true if this HtmlTag "matches" the other
 /// HtmlTag and false otherwise.
 /// </returns>
 public bool Matches(HtmlTag other)
 {
     return(other != null && string.Equals(Element, other.Element,
                                           StringComparison.OrdinalIgnoreCase) && IsOpenTag != other.IsOpenTag);
 }