Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (DeviceName.Length != 0)
            {
                hash ^= DeviceName.GetHashCode();
            }
            if (InterfaceName.Length != 0)
            {
                hash ^= InterfaceName.GetHashCode();
            }
            if (Address.Length != 0)
            {
                hash ^= Address.GetHashCode();
            }
            if (DeviceDetails.Length != 0)
            {
                hash ^= DeviceDetails.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
 public override int ComputeKey()
 {
     unchecked {
         var hashCode = BindingFlags.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsField.GetHashCode();
         hashCode = (hashCode * 397) ^ (FallbackAction != null ? FallbackAction.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (GetterFallbackAction != null ? GetterFallbackAction.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SetterFallbackAction != null ? SetterFallbackAction.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (InterfaceName != null ? InterfaceName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FallbackMode != null ? FallbackMode.GetHashCode() : 0);
         return(hashCode);
     }
 }