/// <summary> /// Tests for equality between the specified object and this /// object. Two CodeSource objects are considered equal if their /// locations are of identical value and if their signer certificate /// chains are of identical value. It is not required that /// the certificate chains be in the same order. /// </summary> /// <param name="obj"> the object to test for equality with this object. /// </param> /// <returns> true if the objects are considered equal, false otherwise. </returns> public override bool Equals(Object obj) { if (obj == this) { return(true); } // objects types must be equal if (!(obj is CodeSource)) { return(false); } CodeSource cs = (CodeSource)obj; // URLs must match if (Location_Renamed == null) { // if location is null, then cs.location must be null as well if (cs.Location_Renamed != null) { return(false); } } else { // if location is not null, then it must equal cs.location if (!Location_Renamed.Equals(cs.Location_Renamed)) { return(false); } } // certs must match return(MatchCerts(cs, true)); }
private static void EnsureCodeSource(CodeSource cSource) { if (cSource == null) throw new InvalidOperationException(); }