コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Earliest != null)
         {
             hashCode = hashCode * 59 + Earliest.GetHashCode();
         }
         if (Latest != null)
         {
             hashCode = hashCode * 59 + Latest.GetHashCode();
         }
         if (Duration != null)
         {
             hashCode = hashCode * 59 + Duration.GetHashCode();
         }
         if (MaxDrivingTime != null)
         {
             hashCode = hashCode * 59 + MaxDrivingTime.GetHashCode();
         }
         if (InitialDrivingTime != null)
         {
             hashCode = hashCode * 59 + InitialDrivingTime.GetHashCode();
         }
         if (PossibleSplit != null)
         {
             hashCode = hashCode * 59 + PossibleSplit.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Earliest != null)
         {
             hashCode = hashCode * 59 + Earliest.GetHashCode();
         }
         if (Latest != null)
         {
             hashCode = hashCode * 59 + Latest.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #3
0
        /// <summary>
        /// Returns true if TimeWindow instances are equal
        /// </summary>
        /// <param name="input">Instance of TimeWindow to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TimeWindow input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Earliest == input.Earliest ||
                     (Earliest != null &&
                      Earliest.Equals(input.Earliest))
                     ) &&
                 (
                     Latest == input.Latest ||
                     (Latest != null &&
                      Latest.Equals(input.Latest))
                 ));
        }
コード例 #4
0
        /// <summary>
        /// Returns true if Break instances are equal
        /// </summary>
        /// <param name="input">Instance of Break to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Break input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Earliest == input.Earliest ||
                     (Earliest != null &&
                      Earliest.Equals(input.Earliest))
                     ) &&
                 (
                     Latest == input.Latest ||
                     (Latest != null &&
                      Latest.Equals(input.Latest))
                 ) &&
                 (
                     Duration == input.Duration ||
                     (Duration != null &&
                      Duration.Equals(input.Duration))
                 ) &&
                 (
                     MaxDrivingTime == input.MaxDrivingTime ||
                     (MaxDrivingTime != null &&
                      MaxDrivingTime.Equals(input.MaxDrivingTime))
                 ) &&
                 (
                     InitialDrivingTime == input.InitialDrivingTime ||
                     (InitialDrivingTime != null &&
                      InitialDrivingTime.Equals(input.InitialDrivingTime))
                 ) &&
                 (
                     PossibleSplit == input.PossibleSplit ||
                     PossibleSplit != null &&
                     PossibleSplit.SequenceEqual(input.PossibleSplit)
                 ));
        }
コード例 #5
0
 public string ToLongTimeString()
 {
     return((Earliest == Latest)
         ? Earliest.ToString("T", System.Globalization.CultureInfo.InvariantCulture)
         : Earliest.ToString("T", System.Globalization.CultureInfo.InvariantCulture) + "-" + Latest.ToString("T", System.Globalization.CultureInfo.InvariantCulture));
 }