Esempio n. 1
0
 /// <summary>
 /// Returns a hashcode based on the information in the identifier.
 /// </summary>
 //^ [Confined]
 public sealed override int GetHashCode()
 {
     if (_hashCode == null)
     {
         _hashCode = ObjectModelHelper.CaseInsensitiveStringHash(this.ToString());
     }
     return((int)_hashCode);
 }
Esempio n. 2
0
        /// <summary>
        /// Computes a hashcode from the name of the modules and the containing assembly (if applicable) or the location (if specified).
        /// </summary>
        internal override int ComputeHashCode()
        {
            int hash = this.Name.UniqueKeyIgnoringCase;

            if (this.ContainingAssembly != null)
            {
                hash = (hash << 4) ^ this.ContainingAssembly.GetHashCode();
            }
            else if (this.Location.Length > 0)
            {
                hash = (hash << 4) ^ ObjectModelHelper.CaseInsensitiveStringHash(this.Location);
            }
            return(hash);
        }
Esempio n. 3
0
        /// <summary>
        /// Computes a hashcode from the name, version, culture and public key token of the assembly identifier.
        /// </summary>
        internal sealed override int ComputeHashCode()
        {
            int hash = this.Name.UniqueKeyIgnoringCase;

            hash = (hash << 8) ^ (this.version.Major << 6) ^ (this.version.Minor << 4) ^ (this.version.MajorRevision << 2) ^ this.version.MinorRevision;
            if (this.Culture.Length > 0)
            {
                hash = (hash << 4) ^ ObjectModelHelper.CaseInsensitiveStringHash(this.Culture);
            }
            foreach (byte b in this.PublicKeyToken)
            {
                hash = (hash << 1) ^ b;
            }
            return(hash);
        }
Esempio n. 4
0
 /// <summary>
 /// Returns a hashcode based on the module name.
 /// </summary>
 //^ [Confined]
 public override int GetHashCode()
 {
     return(ObjectModelHelper.CaseInsensitiveStringHash(this.ToString()));
 }