XhtmlLinkCollection

Ecng.Net.Sitemap

A collection of XHTML links that prevents duplicate hreflang values. Used to manage alternate language versions for a sitemap URL.

实现: ICollection<XhtmlLink>, IEnumerable<XhtmlLink>, IEnumerable

属性

Count
public int Count { get; }
value = xhtmlLinkCollection.Count

Gets the number of XHTML links in the collection.

IsReadOnly
public bool IsReadOnly { get; }
value = xhtmlLinkCollection.IsReadOnly

Gets a value indicating whether the collection is read-only.

方法

Clear
public void Clear()
xhtmlLinkCollection.Clear()

Removes all XHTML links from the collection.

ContainsHreflang
public bool ContainsHreflang(string hreflang)
result = xhtmlLinkCollection.ContainsHreflang(hreflang)

Determines whether the collection contains a link with the specified hreflang.

hreflang
The language code to search for.

返回值: true if a link with the specified hreflang is found; otherwise, false.

CopyTo
public void CopyTo(XhtmlLink[] array, int arrayIndex)
xhtmlLinkCollection.CopyTo(array, arrayIndex)

Copies the XHTML links to an Array, starting at a particular Array index.

array
The destination array.
arrayIndex
The zero-based index in array at which copying begins.
GetEnumerator
public IEnumerator<XhtmlLink> GetEnumerator()
result = xhtmlLinkCollection.GetEnumerator()

Returns an enumerator that iterates through the collection.

返回值: An enumerator for the collection.

RemoveHreflang
public bool RemoveHreflang(string hreflang)
result = xhtmlLinkCollection.RemoveHreflang(hreflang)

Removes the XHTML link with the specified hreflang from the collection.

hreflang
The language code of the link to remove.

返回值: true if the link was successfully removed; otherwise, false.

System#Collections#IEnumerable#GetEnumerator()

Returns an enumerator that iterates through the collection.

返回值: An enumerator for the collection.