System.ApplicationId.Equals C# (CSharp) Method

Equals() public method

public Equals ( object o ) : bool
o object
return bool
        public override bool Equals (object o)
        {
            ApplicationId other = (o as ApplicationId);
            if (other == null)
                return false;
 
            if (!(Equals(Name, other.Name) &&
                  Equals(Version, other.Version) &&
                  Equals(ProcessorArchitecture, other.ProcessorArchitecture) &&
                  Equals(Culture, other.Culture)))
                return false;
 
            if (_publicKeyToken.Length != other._publicKeyToken.Length)
                return false;
 
            for (int i = 0; i < _publicKeyToken.Length; i++)
            {
                if (_publicKeyToken[i] != other._publicKeyToken[i])
                    return false;
            }
 
            return true;
        }
 

Usage Example

Beispiel #1
0
		public void Equals ()
		{
			ApplicationId id1 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, defaultCulture);
			ApplicationId id2 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, defaultCulture);
			Assert.IsTrue (id1.Equals (id2), "Equals-1");
			Assert.IsTrue (id2.Equals (id1), "Equals-2");
			Assert.AreEqual (id1.GetHashCode (), id2.GetHashCode (), "GetHashCode");
		}
All Usage Examples Of System.ApplicationId::Equals