/// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ExternalId != null)
         {
             hashCode = hashCode * 59 + ExternalId.GetHashCode();
         }
         if (Metadata != null)
         {
             hashCode = hashCode * 59 + Metadata.GetHashCode();
         }
         if (SensorType != null)
         {
             hashCode = hashCode * 59 + SensorType.GetHashCode();
         }
         if (UnitOfMeasurement != null)
         {
             hashCode = hashCode * 59 + UnitOfMeasurement.GetHashCode();
         }
         if (fixedLatitude != null)
         {
             hashCode = hashCode * 59 + fixedLatitude.GetHashCode();
         }
         if (fixedLongitude != null)
         {
             hashCode = hashCode * 59 + fixedLongitude.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
 public PerformanceItem(string name, SensorType sensorType, float value, string unit)
 {
     Name  = name;
     Value = value;
     Unit  = unit;
     Type  = (CustomType)Enum.Parse(typeof(CustomType), sensorType.GetHashCode().ToString());
 }
Пример #3
0
 public override int GetHashCode()
 {
     return(_type.GetHashCode());
 }