XNodeEqualityComparer Constructor
Definition
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.
Initializes a new instance of the XNodeEqualityComparer class.
public:
XNodeEqualityComparer();
public XNodeEqualityComparer ();
Public Sub New ()
Examples
The following example uses this class to determine whether two nodes are equal.
XElement xmlTree1 = new XElement("Root",
new XAttribute("Att1", 1),
new XAttribute("Att2", 2),
new XElement("Child1", 1),
new XElement("Child2", "some content")
);
XElement xmlTree2 = new XElement("Root",
new XAttribute("Att1", 1),
new XAttribute("Att2", 2),
new XElement("Child1", 1),
new XElement("Child2", "some content")
);
XNodeEqualityComparer equalityComparer = new XNodeEqualityComparer();
Console.WriteLine(equalityComparer.Equals(xmlTree1, xmlTree2));
xmlTree2.Add(new XElement("NewChild", "new content"));
Console.WriteLine(equalityComparer.Equals(xmlTree1, xmlTree2));
This example produces the following output:
True
False
Applies to
See also
Spolupráca s nami v službe GitHub
Zdroj tohto obsahu nájdete v službe GitHub, kde môžete vytvárať a skúmať problémy a žiadosti o prijatie zmien. Ďalšie informácie nájdete v našom sprievodcovi prispievateľom.