示例#1
0
        public override int GetHashCode()
        {
            var hashCode = 0;

            unchecked
            {
                if (LeftContext != null)
                {
                    hashCode = (23 * hashCode) + LeftContext.GetHashCode();
                }
                if (LeftValue != null)
                {
                    hashCode = (23 * hashCode) + LeftValue.GetHashCode();
                }
                if (LeftSetter != null)
                {
                    hashCode = (23 * hashCode) + LeftSetter.GetHashCode();
                }
                if (RightValue != null)
                {
                    hashCode = (23 * hashCode) + RightValue.GetHashCode();
                }
                if (RightSetter != null)
                {
                    hashCode = (23 * hashCode) + RightSetter.GetHashCode();
                }
                if (RightContext != null)
                {
                    hashCode = (23 * hashCode) + RightContext.GetHashCode();
                }
            }
            return(hashCode);
        }
示例#2
0
 public bool Equals(ContextPair o)
 {
     if (this == o)
     {
         return(true);
     }
     return(LeftContext.Equals(o.LeftContext) && RightContext.Equals(o.RightContext));
 }
示例#3
0
 /**
  * /// Determines if the given object is equal to this UnitContext
  *
  * /// @param o the object to compare to
  * /// @return <code>true</code> if the objects are equal return;
  */
 public override bool Equals(Object o)
 {
     if (this == o)
     {
         return(true);
     }
     else if (o is ContextPair)
     {
         ContextPair other = (ContextPair)o;
         return(LeftContext.Equals(other.LeftContext) && RightContext.Equals(other.RightContext));
     }
     return(false);
 }