GacMembershipCondition.Equals(Object) Method

Definition

Indicates whether the current object is equivalent to the specified object.

C#
public override bool Equals(object o);

Parameters

o
Object

The object to compare with the current object.

Returns

true if o is a GacMembershipCondition; otherwise, false.

Implements

Examples

The following code example shows the use of the Equals method. This example is part of a larger example provided for the GacMembershipCondition class.

C#
GacMembershipCondition Gac1 = new GacMembershipCondition();
GacMembershipCondition Gac2 = new GacMembershipCondition();

// Roundtrip a GacMembershipCondition to and from an XML encoding.
Gac2.FromXml(Gac1.ToXml());
bool result = Gac2.Equals(Gac1);
if (result)
{
    Console.WriteLine(
        "Result of ToXml() = " + Gac2.ToXml().ToString());
    Console.WriteLine(
        "Result of ToFromXml roundtrip = " + Gac2.ToString());
}
else
{
    Console.WriteLine(Gac2.ToString());
    Console.WriteLine(Gac1.ToString());
    return false;
}

Remarks

There are no degrees of global assembly cache membership. An assembly is either in the cache or it is not. If the object identified by o is a GacMembershipCondition, then the objects being compared are equal. This method returns false only if o is null or if o is not a GacMembershipCondition.

Applies to

Producto Versiones
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 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 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10