XhtmlLink
Represents an XHTML link element for sitemap alternate language pages (hreflang). Used to specify alternate language versions of the same content for multilingual websites.
Конструкторы
public XhtmlLink(string href, string hreflang)
xhtmlLink = XhtmlLink(href, hreflang)
Initializes a new instance of the XhtmlLink class.
- href
- The URL of the alternate language version.
- hreflang
- The language code for this alternate version (e.g., "en", "fr", "en-US", "x-default").
Свойства
public string Href { get; }
value = xhtmlLink.Href
Gets the URL of the alternate language version. This URL must be absolute and properly formatted.
public string Hreflang { get; }
value = xhtmlLink.Hreflang
Gets the language code for this alternate version. Valid values include ISO 639-1 language codes (e.g., "en", "fr"), regional language codes (e.g., "en-US", "fr-CA"), and the special value "x-default" for the default language version.
public string Rel { get; }
value = xhtmlLink.Rel
Gets the relationship type for this link. Always returns "alternate" for XHTML sitemap links.
Методы
public override bool Equals(object obj)
result = xhtmlLink.Equals(obj)
Determines whether the specified object is equal to the current object. Two XhtmlLink objects are considered equal if they have the same Hreflang value.
- obj
- The object to compare with the current object.
Возвращает: true if the specified object is equal to the current object; otherwise, false.
public override int GetHashCode()
result = xhtmlLink.GetHashCode()
Returns a hash code for this instance.
Возвращает: A hash code for this instance.
public override string ToString()
result = xhtmlLink.ToString()
Returns a string representation of this XHTML link.
Возвращает: A string in the format "hreflang: href".