XNamespace.Equality(XNamespace, XNamespace) Operator
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value indicating whether two instances of XNamespace are equal.
public:
static bool operator ==(System::Xml::Linq::XNamespace ^ left, System::Xml::Linq::XNamespace ^ right);
public static bool operator ==(System.Xml.Linq.XNamespace left, System.Xml.Linq.XNamespace right);
public static bool operator ==(System.Xml.Linq.XNamespace? left, System.Xml.Linq.XNamespace? right);
static member ( = ) : System.Xml.Linq.XNamespace * System.Xml.Linq.XNamespace -> bool
Public Shared Operator == (left As XNamespace, right As XNamespace) As Boolean
- left
- XNamespace
The first XNamespace to compare.
- right
- XNamespace
The second XNamespace to compare.
A Boolean that indicates whether left
and right
are equal.
The following example shows the comparison of an XNamespace and a string.
XNamespace aw = "http://www.adventure-works.com";
Console.WriteLine(aw == "http://www.adventure-works.com");
Imports <xmlns="http://www.adventure-works.com">
Module Module1
Sub Main()
Dim aw As XNamespace = GetXmlNamespace()
Console.WriteLine(aw = "http://www.adventure-works.com")
End Sub
End Module
This example produces the following output:
True
The operator overloads ==
and !=
are provided to enable comparisons between XNamespace and string (for example, element.Name.Namespace == "http://www.adventure-works.com"
). The predefined reference equality operators in C# require one operand to be convertible to the type of the other through reference conversions only, and do not consider the implicit conversion from string to XNamespace.
Termék | Verziók |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET-visszajelzés
A(z) .NET egy nyílt forráskód projekt. Visszajelzés adásához válasszon egy hivatkozást: