Bewerken

Share via


XNamespace.Equals(Object) Method

Definition

Determines whether the specified XNamespace is equal to the current XNamespace.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
public override bool Equals (object? obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

Parameters

obj
Object

The XNamespace to compare to the current XNamespace.

Returns

A Boolean that indicates whether the specified XNamespace is equal to the current XNamespace.

Examples

The following example compares two namespaces that refer to the same URI.

XNamespace aw = "http://www.adventure-works.com";
Console.WriteLine(aw == "http://www.adventure-works.com");
Imports <xmlns:aw="http://www.adventure-works.com">

Module Module1
    Sub Main()
        Console.WriteLine(GetXmlNamespace(aw) = "http://www.adventure-works.com")
    End Sub
End Module

This example produces the following output:

True

Remarks

For two XNamespace objects to be equal, they must have the same URI.

Applies to

See also