Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (int)EventType;
         hashCode = (hashCode * 397) ^ (int)DeviceType;
         hashCode = (hashCode * 397) ^ (int)PointerId;
         hashCode = (hashCode * 397) ^ Position.GetHashCode();
         hashCode = (hashCode * 397) ^ Timestamp.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)KeyModifiers;
         hashCode = (hashCode * 397) ^ ContactRect.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBarrelButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsCanceled.GetHashCode();
         hashCode = (hashCode * 397) ^ IsEraser.GetHashCode();
         hashCode = (hashCode * 397) ^ IsHorizontalMouseWheel.GetHashCode();
         hashCode = (hashCode * 397) ^ IsInRange.GetHashCode();
         hashCode = (hashCode * 397) ^ IsInverted.GetHashCode();
         hashCode = (hashCode * 397) ^ IsLeftButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsMiddleButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsRightButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsXButton1Pressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsXButton2Pressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsPrimary.GetHashCode();
         hashCode = (hashCode * 397) ^ MouseWheelDelta;
         hashCode = (hashCode * 397) ^ Orientation.GetHashCode();
         hashCode = (hashCode * 397) ^ TouchConfidence.GetHashCode();
         hashCode = (hashCode * 397) ^ Twist.GetHashCode();
         hashCode = (hashCode * 397) ^ XTilt.GetHashCode();
         hashCode = (hashCode * 397) ^ YTilt.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)PointerUpdateKind;
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (amount_ != null)
            {
                hash ^= Amount.GetHashCode();
            }
            if (IsCanceled != false)
            {
                hash ^= IsCanceled.GetHashCode();
            }
            if (PaymentType != 0)
            {
                hash ^= PaymentType.GetHashCode();
            }
            if (receivedBy_ != null)
            {
                hash ^= ReceivedBy.GetHashCode();
            }
            if (postedAt_ != null)
            {
                hash ^= PostedAt.GetHashCode();
            }
            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            return(hash);
        }
Esempio n. 3
0
 public Task <bool> AllProgressComplete()
 {
     lock (_progressTrackers) {
         while (_progressTrackers.Any())
         {
             CompleteProgress(_progressTrackers.FirstOrDefault().Id, true);
         }
     }
     return(IsCanceled.AsResultTask());
 }
Esempio n. 4
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (IsCanceled != null)
                {
                    hashCode = hashCode * 59 + IsCanceled.GetHashCode();
                }

                if (IsError != null)
                {
                    hashCode = hashCode * 59 + IsError.GetHashCode();
                }

                if (ErrorCode != null)
                {
                    hashCode = hashCode * 59 + ErrorCode.GetHashCode();
                }

                if (AccessToken != null)
                {
                    hashCode = hashCode * 59 + AccessToken.GetHashCode();
                }

                if (IdToken != null)
                {
                    hashCode = hashCode * 59 + IdToken.GetHashCode();
                }

                if (Scopes != null)
                {
                    hashCode = hashCode * 59 + Scopes.GetHashCode();
                }

                if (ExpiresOn != null)
                {
                    hashCode = hashCode * 59 + ExpiresOn.GetHashCode();
                }

                return(hashCode);
            }
        }
Esempio n. 5
0
        /// <summary>
        ///     Returns true if MsalAuthenticationResult instances are equal
        /// </summary>
        /// <param name="other">Instance of MsalAuthenticationResult to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MsalAuthenticationResult other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((IsCanceled == other.IsCanceled || IsCanceled != null && IsCanceled.Equals(other.IsCanceled)) &&
                   (IsError == other.IsError || IsError != null && IsError.Equals(other.IsError)) &&
                   (ErrorCode == other.ErrorCode || ErrorCode != null && ErrorCode.Equals(other.ErrorCode)) &&
                   (AccessToken == other.AccessToken || AccessToken != null && AccessToken.Equals(other.AccessToken)) &&
                   (IdToken == other.IdToken || IdToken != null && IdToken.Equals(other.IdToken)) &&
                   (Scopes == other.Scopes || Scopes != null && Scopes.Equals(other.Scopes)) &&
                   (ExpiresOn == other.ExpiresOn || ExpiresOn != null && ExpiresOn.Equals(other.ExpiresOn)));
        }
Esempio n. 6
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
 public bool Equals(PointerPoint other)
 {
     return(EventType == other.EventType && DeviceType == other.DeviceType && PointerId == other.PointerId && Position.Equals(other.Position) && Timestamp == other.Timestamp && KeyModifiers == other.KeyModifiers && ContactRect.Equals(other.ContactRect) && IsBarrelButtonPressed.Equals(other.IsBarrelButtonPressed) && IsCanceled.Equals(other.IsCanceled) && IsEraser.Equals(other.IsEraser) && IsHorizontalMouseWheel.Equals(other.IsHorizontalMouseWheel) && IsInRange.Equals(other.IsInRange) && IsInverted.Equals(other.IsInverted) && IsLeftButtonPressed.Equals(other.IsLeftButtonPressed) && IsMiddleButtonPressed.Equals(other.IsMiddleButtonPressed) && IsRightButtonPressed.Equals(other.IsRightButtonPressed) && IsXButton1Pressed.Equals(other.IsXButton1Pressed) && IsXButton2Pressed.Equals(other.IsXButton2Pressed) && IsPrimary.Equals(other.IsPrimary) && MouseWheelDelta == other.MouseWheelDelta && Orientation.Equals(other.Orientation) && TouchConfidence.Equals(other.TouchConfidence) && Twist.Equals(other.Twist) && XTilt.Equals(other.XTilt) && YTilt.Equals(other.YTilt) && PointerUpdateKind == other.PointerUpdateKind);
 }