GacInstalled.Equals Method (Object)

 

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

Namespace:   System.Security.Policy
Assembly:  mscorlib (in mscorlib.dll)

public override bool Equals(
	object o
)

Parameters

o
Type: System.Object

The object to compare with the current object.

Return Value

Type: System.Boolean

true if o is a GacInstalled object; otherwise, false.

GacInstalled objects have no properties to distinguish one from another, so all GacInstalled objects are equal.

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

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;
}

.NET Framework
Available since 2.0
Return to top
Show: