RegionInfo.Equals Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Determines whether the specified object is the same as the current RegionInfo object.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
- Type: System.Object
The object to compare with the current RegionInfo.
Return Value
Type: System.Booleantrue if the value parameter is a RegionInfo object and its Name property is the same as the Name property of the current RegionInfo object; otherwise, false.
This method overrides Object.Equals.
The following code example compares two instances of RegionInfo that were created differently.
using System; using System.Globalization; public class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { // Creates a RegionInfo using the es-US culture name. RegionInfo myRI1 = new RegionInfo("es-US"); // Creates a RegionInfo using a CultureInfo Name property RegionInfo myRI2 = new RegionInfo(new CultureInfo("en-US").Name); // Compares the two instances. if (myRI1.Equals(myRI2)) outputBlock.Text += "The two RegionInfo instances are equal." + "\n"; else outputBlock.Text += "The two RegionInfo instances are NOT equal." + "\n"; } } /* This code produces the following output. The two RegionInfo instances are equal. */
Show: