Beispiel #1
0
 public bool IsSameMessage(Message another)
 {
     if (another == null)
     {
         return(false);
     }
     return(LocalTimestamp.Equals(another.LocalTimestamp));
 }
Beispiel #2
0
 internal async Task LoadFile(string fileKey, string filePath)
 {
     FileID         = fileKey;
     LocalPath      = filePath;
     Found          = File.Exists(LocalPath);
     LocalSHA1      = Found ? LocalPath.SHA1ForFile() : "--";
     LocalVersion   = Found ? LocalPath.GetVersion()  : "--";
     LocalTimestamp = Found ? File.GetLastWriteTime(LocalPath) : (DateTime?)null;
     LocalDate      = LocalTimestamp?.TimeAgo() ?? "--";
     RemoteSHA1     = "--";
     RemoteVersion  = "--";
     RemoteDate     = "--";
     DownloadURL    = "--";
     IsSame         = true;
     await RefreshCmd.RunAsync();
 }
 public string[] Values()
 {
     return(new string[] {
         AssetName,
         LocalTimestamp.HasValue ? LocalTimestamp.ToString() : "",
         "" + UTCMilliseconds,
         "" + CompressorOilPressure,
         "" + CompressorOilTemp,
         "" + CompressorStages,
         "" + Cylinder1DischargeTemp,
         "" + Cylinder2DischargeTemp,
         "" + Cylinder3DischargeTemp,
         "" + Cylinder4DischargeTemp,
         "" + DowntimeHrsYest,
         "" + EngineOilPressure,
         "" + EngineOilTemp,
         FacilityDesc,
         "" + FuelPressure,
         "" + GasFlowRate,
         "" + GasFlowRate_RAW,
         "" + Horsepower,
         LastSuccessfulCommTime.HasValue ? LastSuccessfulCommTime.ToString() : "",
         "" + MaxDischargePressure,
         "" + MaxGasFlowrate,
         "" + MaxRPMs,
         "" + MaxSuctionPressure,
         "" + PctSuccessfulMsgsToday,
         "" + (RPM.HasValue ? "" + (int)RPM.Value : ""),
         RunStatus,
         "" + RuntimeHrs,
         SDStatusCode,
         "" + Stage1DischargePressure,
         "" + Stage2DischargePressure,
         "" + Stage3DischargePressure,
         "" + SuctionPressure,
         "" + SuctionTemp,
         UnitSize
     });
     //return new string[]
     //{
     //    "value",//+AssetName,
     //    "",//+ (LocalTimestamp.HasValue ? LocalTimestamp.Value.ToString() : ""),
     //    "0",//+UTCMilliseconds,
     //    "0",//+CompressorOilPressure,
     //    "0",//+CompressorOilTemp,
     //    "0",//+CompressorStages,
     //    "0",//+Cylinder1DischargeTemp,
     //    "0",//+Cylinder2DischargeTemp,
     //    "0",//+Cylinder3DischargeTemp,
     //    "0",//+Cylinder4DischargeTemp,
     //    "0",//+DowntimeHrsYest,
     //    "0",//+EngineOilPressure,
     //    "0",//+EngineOilTemp,
     //    "0",//+FacilityDesc,
     //    "0",//+FuelPressure,
     //    "0",//+GasFlowRate,
     //    "0",//+GasFlowRate_RAW,
     //    "0",//+Horsepower,
     //    "value",//+(LastSuccessfulCommTime.HasValue ? LastSuccessfulCommTime.Value.ToString() : ""),
     //    "0",//+MaxDischargePressure,
     //    "0",//+MaxGasFlowrate,
     //    "0",//+MaxRPMs,
     //    "0",//+MaxSuctionPressure,
     //    "value",//+PctSuccessfulMsgsToday,
     //    "0",//+RPM,
     //    "0",//+RunStatus,
     //    "0",//+RuntimeHrs,
     //    "0",
     //    "0",
     //    "0",
     //    "value",//+SDStatusCode,
     //    "0",//+Stage1DischargePressure,
     //    "0",//+Stage2DischargePressure,
     //    "0",//+Stage3DischargePressure,
     //    "0",//+SuctionPressure,
     //    "0",//+SuctionTemp,
     //    "value",//+UnitSize
     //};
 }
Beispiel #4
0
        public override string ToOData()
        {
            var template = @"
    ""PartitionKey"":""{0}"",
    ""RowKey"":""{1}"",
    ""Type"":""{2}"",
    ""Currency"":""{3}"",
    ""Category"":""{4}"",
    ""*****@*****.**"":""Edm.DateTime"",
    ""LocalTimestamp"":""{5}"",
    ""Value"":{6}  
";

            return("{" + string.Format(template,
                                       PartitionKey, RowKey, Type, Currency, Category, LocalTimestamp.ToJson(), Value) + "}");
        }
Beispiel #5
0
 /// <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 (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Timestamp != null)
         {
             hashCode = hashCode * 59 + Timestamp.GetHashCode();
         }
         if (LocalTimestamp != null)
         {
             hashCode = hashCode * 59 + LocalTimestamp.GetHashCode();
         }
         if (ServiceUrl != null)
         {
             hashCode = hashCode * 59 + ServiceUrl.GetHashCode();
         }
         if (ChannelId != null)
         {
             hashCode = hashCode * 59 + ChannelId.GetHashCode();
         }
         if (From != null)
         {
             hashCode = hashCode * 59 + From.GetHashCode();
         }
         if (Conversation != null)
         {
             hashCode = hashCode * 59 + Conversation.GetHashCode();
         }
         if (Recipient != null)
         {
             hashCode = hashCode * 59 + Recipient.GetHashCode();
         }
         if (TextFormat != null)
         {
             hashCode = hashCode * 59 + TextFormat.GetHashCode();
         }
         if (AttachmentLayout != null)
         {
             hashCode = hashCode * 59 + AttachmentLayout.GetHashCode();
         }
         if (MembersAdded != null)
         {
             hashCode = hashCode * 59 + MembersAdded.GetHashCode();
         }
         if (MembersRemoved != null)
         {
             hashCode = hashCode * 59 + MembersRemoved.GetHashCode();
         }
         if (TopicName != null)
         {
             hashCode = hashCode * 59 + TopicName.GetHashCode();
         }
         if (HistoryDisclosed != null)
         {
             hashCode = hashCode * 59 + HistoryDisclosed.GetHashCode();
         }
         if (Locale != null)
         {
             hashCode = hashCode * 59 + Locale.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (Speak != null)
         {
             hashCode = hashCode * 59 + Speak.GetHashCode();
         }
         if (InputHint != null)
         {
             hashCode = hashCode * 59 + InputHint.GetHashCode();
         }
         if (Summary != null)
         {
             hashCode = hashCode * 59 + Summary.GetHashCode();
         }
         if (SuggestedActions != null)
         {
             hashCode = hashCode * 59 + SuggestedActions.GetHashCode();
         }
         if (Attachments != null)
         {
             hashCode = hashCode * 59 + Attachments.GetHashCode();
         }
         if (Entities != null)
         {
             hashCode = hashCode * 59 + Entities.GetHashCode();
         }
         if (ChannelData != null)
         {
             hashCode = hashCode * 59 + ChannelData.GetHashCode();
         }
         if (Action != null)
         {
             hashCode = hashCode * 59 + Action.GetHashCode();
         }
         if (ReplyToId != null)
         {
             hashCode = hashCode * 59 + ReplyToId.GetHashCode();
         }
         if (Value != null)
         {
             hashCode = hashCode * 59 + Value.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (RelatesTo != null)
         {
             hashCode = hashCode * 59 + RelatesTo.GetHashCode();
         }
         if (Code != null)
         {
             hashCode = hashCode * 59 + Code.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #6
0
        /// <summary>
        /// Returns true if Activity instances are equal
        /// </summary>
        /// <param name="other">Instance of Activity to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Activity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Timestamp == other.Timestamp ||
                     Timestamp != null &&
                     Timestamp.Equals(other.Timestamp)
                 ) &&
                 (
                     LocalTimestamp == other.LocalTimestamp ||
                     LocalTimestamp != null &&
                     LocalTimestamp.Equals(other.LocalTimestamp)
                 ) &&
                 (
                     ServiceUrl == other.ServiceUrl ||
                     ServiceUrl != null &&
                     ServiceUrl.Equals(other.ServiceUrl)
                 ) &&
                 (
                     ChannelId == other.ChannelId ||
                     ChannelId != null &&
                     ChannelId.Equals(other.ChannelId)
                 ) &&
                 (
                     From == other.From ||
                     From != null &&
                     From.Equals(other.From)
                 ) &&
                 (
                     Conversation == other.Conversation ||
                     Conversation != null &&
                     Conversation.Equals(other.Conversation)
                 ) &&
                 (
                     Recipient == other.Recipient ||
                     Recipient != null &&
                     Recipient.Equals(other.Recipient)
                 ) &&
                 (
                     TextFormat == other.TextFormat ||
                     TextFormat != null &&
                     TextFormat.Equals(other.TextFormat)
                 ) &&
                 (
                     AttachmentLayout == other.AttachmentLayout ||
                     AttachmentLayout != null &&
                     AttachmentLayout.Equals(other.AttachmentLayout)
                 ) &&
                 (
                     MembersAdded == other.MembersAdded ||
                     MembersAdded != null &&
                     MembersAdded.SequenceEqual(other.MembersAdded)
                 ) &&
                 (
                     MembersRemoved == other.MembersRemoved ||
                     MembersRemoved != null &&
                     MembersRemoved.SequenceEqual(other.MembersRemoved)
                 ) &&
                 (
                     TopicName == other.TopicName ||
                     TopicName != null &&
                     TopicName.Equals(other.TopicName)
                 ) &&
                 (
                     HistoryDisclosed == other.HistoryDisclosed ||
                     HistoryDisclosed != null &&
                     HistoryDisclosed.Equals(other.HistoryDisclosed)
                 ) &&
                 (
                     Locale == other.Locale ||
                     Locale != null &&
                     Locale.Equals(other.Locale)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Speak == other.Speak ||
                     Speak != null &&
                     Speak.Equals(other.Speak)
                 ) &&
                 (
                     InputHint == other.InputHint ||
                     InputHint != null &&
                     InputHint.Equals(other.InputHint)
                 ) &&
                 (
                     Summary == other.Summary ||
                     Summary != null &&
                     Summary.Equals(other.Summary)
                 ) &&
                 (
                     SuggestedActions == other.SuggestedActions ||
                     SuggestedActions != null &&
                     SuggestedActions.Equals(other.SuggestedActions)
                 ) &&
                 (
                     Attachments == other.Attachments ||
                     Attachments != null &&
                     Attachments.SequenceEqual(other.Attachments)
                 ) &&
                 (
                     Entities == other.Entities ||
                     Entities != null &&
                     Entities.SequenceEqual(other.Entities)
                 ) &&
                 (
                     ChannelData == other.ChannelData ||
                     ChannelData != null &&
                     ChannelData.Equals(other.ChannelData)
                 ) &&
                 (
                     Action == other.Action ||
                     Action != null &&
                     Action.Equals(other.Action)
                 ) &&
                 (
                     ReplyToId == other.ReplyToId ||
                     ReplyToId != null &&
                     ReplyToId.Equals(other.ReplyToId)
                 ) &&
                 (
                     Value == other.Value ||
                     Value != null &&
                     Value.Equals(other.Value)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     RelatesTo == other.RelatesTo ||
                     RelatesTo != null &&
                     RelatesTo.Equals(other.RelatesTo)
                 ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ));
        }